#include<iostream>
#include<queue>
#include<vector>
#include<algorithm>
#include<cassert>
#include<set>
#include<cassert>
using namespace std;
#define REP(i,b,n) for(int i=b;i<n;i++)
#define rep(i,n)   REP(i,0,n)
#define ALL(c)   (c).begin(),(c).end()
#define pb push_back

typedef long long ll;

bool vis[10][10];
char m[10][10];
int check[10][10];

int dx[]={0,1,0,-1};
int dy[]={1,0,-1,0};

bool isout(int ney,int nex,int r,int c){
  return nex==-1||ney==-1||nex==c||ney==r;
}

bool isok(int y,int x,int r,int c){
  int all=0,cnt=0;
  rep(i,4){
    int nex=x+dx[i],ney=y+dy[i];
    if (isout(ney,nex,r,c))continue;
    all++;
    if (m[ney][nex] == '0')cnt++;
  }
  if (cnt <= 1)return false;
  return true;
}

bool vis2[10][10];
void canvisitall(int r,int c,int y,int x,
		 int &tmp){
  if (vis2[y][x])return;
  //  cout << y <<" "  << x << endl;
  vis2[y][x]=true;
  tmp--;
  rep(i,4){
    int nex=x+dx[i],ney=y+dy[i];
    if (isout(ney,nex,r,c)||
	m[ney][nex] == '1')continue;
    canvisitall(r,c,ney,nex,tmp);
  }
}

ll geta(int r,int c){
  ll ret=0;
  rep(i,r){
    rep(j,c)ret=ret*2+vis[i][j];
  }
  return ret;
}

set<ll> S;
int ini;
bool search(int r,int c,int y,int x,int cnt,
	    int sy,int sx,int py,int px){
  if (cnt==0){
    /*
    if (x==sx && y == sy){
      rep(i,r){
	rep(j,c){
	  if (m[i][j] == '1')cout << -1 <<" ";
	  else cout<<check[i][j] <<" ";
	}
	cout << endl;
      }
    }
    */
    return x==sx && y == sy;
  }
  if (vis[y][x])return false;
  check[y][x]=cnt;

  int tmp=cnt+1;
  rep(i,r)rep(j,c)vis2[i][j]=vis[i][j];
  vis2[sy][sx]=false;

  canvisitall(r,c,y,x,tmp);
  if ((x!=sx||y!=sy) && tmp != 0){
    return false;
  }

  vis[y][x]=true;

  ll tmp2=geta(r,c);
  if (S.find(tmp2) != S.end()){
    vis[y][x]=false;
    return false;
  }
  S.insert(tmp2);



  rep(i,4){
    int nex=x+dx[i],ney=y+dy[i];
    if (isout(ney,nex,r,c)||
	m[ney][nex] == '1')continue;
    if (nex == px && ney == py)continue;
    if (search(r,c,ney,nex,cnt-1,sy,sx,y,x))return true;
  }
  vis[y][x]=false;
  return false;
}

int main(){
  int r,c;
  while(cin>>c>>r && r){
    S.clear();
    int sx=0,sy=0;
    int cnt=0;
    bool haveans=true;
    rep(i,r){
      rep(j,c){
	cin>>m[i][j];
	if (m[i][j] == '0')sx=j,sy=i,cnt++;
	vis[i][j]=false;
      }
    }

    rep(i,r){
      rep(j,c){
	//if (m[i][j]=='0'&&!isok(i,j,r,c))haveans=false;
      }
    }

    if (r==7 && c==7 && cnt == 49){
      //haveans=false;
      //cout <<"Yes"<<endl;
      //continue;
    }
    ini=cnt;
    if (ini == 1||ini == 0){
      //cout <<"Yes" << endl;
      cout <<"No" << endl;
      continue;
    }
    if (ini > 1 && haveans && search(r,c,sy,sx,cnt,sy,sx,-1,-1))
      cout << "Yes" << endl;
    else cout <<"No" << endl;
  }
  return false;
}