#include <iostream>
using namespace std;

int x,y,cn,k,dx[4]={1,0,-1,0},dy[4]={0,-1,0,1},mp[9][9];

void cnt2(int cx,int cy) {
	int i;
	cn++;
	mp[cy][cx]=2;
	for (i=0;i<4;i++) if (mp[cy+dy[i]][cx+dx[i]]==0) cnt2(cx+dx[i],cy+dy[i]);
	}

void cnt() {
	int i,j;
	cn=0;
	for (i=1;i<=y;i++) for (j=1;j<=x;j++) if (mp[i][j]==0) {cn=0; cnt2(j,i); j=i=10;}
	for (i=1;i<=y;i++) for (j=1;j<=x;j++) if (mp[i][j]==2) mp[i][j]=0;
}	
	
	
	
int search(int sx,int sy,int bn) {
	int i,j,c;
	c=0;
	for (i=sy-1;i<=sy+1;i++) for (j=sx-1;j<=sx+1;j++) if (mp[i][j]!=0) c++;
	if (c>2) cnt();
	if (cn+bn!=x*y) return 0;
	for (i=0;i<4;i++) {
		 if (mp[sy+dy[i]][sx+dx[i]]==3 && bn==x*y) return 1;
		 if (mp[sy+dy[i]][sx+dx[i]]==0) {
			 mp[sy+dy[i]][sx+dx[i]]=1;
			 if (search(sx+dx[i],sy+dy[i],bn+1)==1) return 1;
			 mp[sy+dy[i]][sx+dx[i]]=0;
	 }
 }
	 return 0;
 }

int main() {
	int i,j,sx,sy,bn,f;
	while(cin >> x >> y) {
		if (x+y==0) break;
		bn=0; sx=-1; k=0;  
		for (i=0;i<9;i++) for (j=0;j<9;j++) mp[i][j]=1;
		for (i=1;i<=y;i++) for (j=1;j<=x;j++) { 
			cin >> mp[i][j]; bn+=mp[i][j]; if (mp[i][j]==0 && sx==-1) { sx=j; sy=i;} } 
		mp[sy][sx]=3; f=0;
		if ((x*y-bn) % 2==1) f=0; else f=search(sx,sy,bn+1);
		if (f==0) cout << "No" << endl; else cout << "Yes" << endl;
		}
	return 0;
  }