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

#include<bits/stdc++.h>

using namespace std;

int main()
{
    ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    //freopen("input.txt","r",stdin);
    int n; cin >> n >> n;
	bool f = 1;
    for (int i=0; i<n; i++)
    {
        for (int j=0; j<n; j++)
        {
            double x; cin >> x;
            if (i!=j && x!=0.0) 
            {
                f = 0;
            }
        }
    }
    if (f) cout << "Yes"; else cout << "No";
    return 0;
}