/*
Task: Problem 7.07
Date: Dec 24, 2020
Author: aLittleLove (Minh Vu)
*/

#include<bits/stdc++.h>

using namespace std;
const int N = 2e3 + 5;

double a[N][N];

int main()
{
    ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    //freopen("input.txt","r",stdin);
    int n; cin >> n >> 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 << "No";
                return 0;
            }
    cout << "Yes";
    return 0;
}