# data[].attributes.attachment_link.readable_text
#include<iostream>
#include<vector>
#include<cmath>
#include<set>
#include<algorithm>

using namespace std;

int a[100][100];
int main() 
{
	int n,m;
	cin >> n;
	for (int i = 0; i < n; ++i) {
		int tmp = 0;
		for (int j = 0; j < n; ++j) {
			cin >> a[i][j];
			tmp += a[i][j];
		}
		if (i == 0) {
			m = tmp;
		}
		else if (tmp != m) {
			cout << "NO";
			return 0;
		}
	}
	cout << "YES";
}

# data[].attributes.attachment_link.readable_text
#include<iostream>
#include<vector>
#include<cmath>
#include<set>
#include<algorithm>

using namespace std;

int a[100][100];
int main() 
{
	int n;
	cin >> n;
	for (int i = 0; i < n; ++i) {
		int tmp = 0;
		for (int j = 0; j < n; ++j) {
			cin >> a[i][j];
			tmp += a[i][j];
		}
		cout << tmp << " ";
	}
	
}

# data[].attributes.attachment_link.readable_text
#include<iostream>
#include<vector>
#include<cmath>
#include<set>
#include<algorithm>

using namespace std;

bool a[100][100];
int main() 
{
	int n;
	cin >> n;
	for (int i = 0; i < n; ++i) {
		int m;
		cin >> m;
		for (int j = 0; j < m; ++j) {
			int c;
			cin >> c;
			a[i][c - 1] = 1;
		}
	}
	cout << n << endl;
	for (int i = 0; i < n; ++i) {
		for (int j = 0; j < n; ++j) {
			cout << a[i][j] << " ";
		}
		cout << endl;
	}
}

# data[].attributes.attachment_link.readable_text
#include<iostream>
#include<vector>
#include<cmath>
#include<set>
#include<algorithm>

using namespace std;

long long a[100][2];
int main() 
{
	long long n,ans=0;
	cin >> n;
	for (int i = 0; i < n - 1; ++i) {
		cin >> a[i][0] >> a[i][1];
	}
	for (int i = 1; i <= n; ++i){
		int tmp=0;
		for (int j = 0; j < n - 1; ++j) {
			if (a[j][0] == i || a[j][1] == i) {
				tmp++;
			}
		}
		if (tmp > 1) {
			ans++;
		}
	}
	cout << ans;
}

# data[].attributes.attachment_link.readable_text
#include<iostream>
#include<vector>
#include<cmath>
#include<set>
#include<algorithm>

using namespace std;

long long a[100][2];
int main() 
{
	long long n,ans=0;
	cin >> n;
	for (int i = 0; i < n - 1; ++i) {
		cin >> a[i][0] >> a[i][1];
	}
	for (int i = 1; i <= n; ++i){
		int tmp=0;
		for (int j = 0; j < n - 1; ++j) {
			if (a[j][0] == i || a[j][1] == i) {
				tmp++;
			}
		}
		if (tmp > 1) {
			ans++;
		}
	}
	cout << ans;
}

# data[].attributes.attachment_link.readable_text
#include<iostream>

using namespace std;

int main() 
{
	unsigned long long n,a,b;
	cin >> n >> a >> b;
	while (a != b) {
		if(a>b){
			a/=2;
		}
		else if(a<b){
			b/=2;
		}
	}
	cout << a;
}

# data[].attributes.attachment_link.readable_text
#include<iostream>
#include<vector>
#include<cmath>
#include<set>
#include<algorithm>
 
using namespace std;
 
int a[100][100];
int main() 
{
    int n;
    cin >> n;
    for (int i = 0; i < n; ++i) {
        for (int j = 0; j < n; ++j) {
            cin >> a[i][j];
        }
    }
    set <int> b;
    for (int i = 0; i < n; ++i) {
        for (int j = 0; j < n; ++j) {
            for (int k = 0; k < n; ++k) {
                if (i != j && j != k && i != k) {
                    b.insert(a[i][j] + a[j][k] + a[k][i]);
                }
            }
        }
    }
    for (auto now : b) {
        cout << now;
        return 0;
    }
}

# data[].attributes.attachment_link.readable_text
#include<iostream>
#include<vector>
#include<cmath>
#include<set>
#include<algorithm>
 
using namespace std;
 
bool a[100][100];
 
int main() 
{
    int n;
    cin >> n;
    for (int i = 0; i < n; ++i) {
        for (int j = 0; j < n; ++j) {
            cin >> a[i][j];
        }
    }
    for (int i = 0; i < n; ++i) {
        for (int j = 0; j < n; ++j) {
            if (a[i][j] != a[j][i]) {
                cout << "YES";
                return 0;
            }
        }
    }
    cout << "NO";
}
