#include<iostream>
using namespace std;
int main()
{
int m,n,i,j,k,p;
long a[100][100];
while(cin>>m>>n)
{
p=0;
k=0;
if(m==0 && n==0) break;
for(i=1;i<=m;i++)
for(j=1;j<=n;j++)
{
cin>>a[i][j];
if(a[i][j]==1)k++;
}
if(k==m*n) {cout<<"No"<<endl;continue;}
for(i=1;i<=m;i++)
for(j=1;j<=n-1;j++)
{if(a[i][j]==0 && a[i][j+1]==0) {p=1; goto Turn;}}
for(i=1;i<=m-1;i++)
for(j=1;j<=n;j++)
{if(a[i][j]==0 && a[i+1][j]==0) {p=1; goto Turn;}}
Turn:if(p==1) cout<<"No"<<endl;
else cout<<"Yes"<<endl;
}
return 0;
}