#include<bits/stdc++.h>
using namespace std;
const int N = 110;
int ma[N][N];
bool flag;
int main(){
int n;
while(cin>>n){
flag = true;
memset(ma,0,sizeof(ma));
for(int i = 1;i<=n;i++){
for(int j = 1;j<=n;j++){
cin>>ma[i][j];
}
}
for(int i = 1;i<=n;i++){
for(int j = 1;j<=i;j++){
if(ma[i][j]!=ma[j][i]){
flag = false;
break;
}
}
}
if(flag){
cout<<"Yes!";
}else{
cout<<"No!";
}
cout<<"\n";
}
return 0;
}