#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
//cout.sync_with_stdio(false); /// 那么cin, 就不能跟C的 scanf,sscanf, getchar, fgets之类的一起使用了。
///1 ~ n;
///1 ~ m;
int chess[110][110];
int n,m;
/// 1 2 3 4 5 6 7
/// 1 0 0 0 0 0 0 0
/// 2 0 0 0 0 0 0 0
/// 3 0 0 0 0 0 0 0
/// 4 0 0 0 0 0 0 0
/// 5 0 0 0 0 0 0 0
inline bool isCanFill(int i,int j){
if ( chess[i][j] + chess[i+1][j] + chess[i][j+1] + chess[i+1][j+1] == 0)
return 1;
return 0;
}
int DFS(){
for (int i = 1;i < n;++i) for (int j = 1;j < m;++j)
if ( isCanFill(i,j) ){
chess[i][j] = chess[i+1][j] = chess[i][j+1]=chess[i+1][j+1] = 1;
if ( 0 == DFS() )
{
///千万别忘了这个 每次都因为这个wr好多次
chess[i][j] = chess[i+1][j] = chess[i][j+1]=chess[i+1][j+1] = 0;
return 1;
}
chess[i][j] = chess[i+1][j] = chess[i][j+1]=chess[i+1][j+1] = 0;
}
return 0;
}
int main(){
char ch[100];
while(scanf("%d%d",&n,&m) != EOF){
for (int i = 1;i <= n;++i)
{
scanf("%s",ch);
for (int j = 0;j < m;++j)
chess[i][j+1] = (ch[j] == '0') ? 0 : 1;
}
if ( DFS() )puts("Yes");
else puts("No");
}
return 0;
}