#include<bits/stdc++.h>
#define int long long
#define INF LLONG_MAX
#define _INF LLONG_MIN
#define ios ios::sync_with_stdio(0),cout.tie(0),cin.tie(0);
using namespace std;
char mp[114][114];
bool flag[114][114];
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
bool flagg=0;
int n,m;
void dfs(int x,int y){
if(x==n&&y==m){
flagg=1;
return ;
}
flag[x][y]=1;
for(int i=0;i<4;i++){
int fx=x+dx[i];
int fy=y+dy[i];
if(fx>=1&&fx<=n&&fy>=1&&fy<=m&&flag[fx][fy]!=1){
dfs(fx,fy);
if(flagg)return ;
}
}
}
const int N=0;
signed main(){
ios
cin>>n>>m;
for(int i=1;i<=n;i++){
for(int j=1;j<=m;j++){
cin>>mp[i][j];
}
}
dfs(1,1);
if(flagg)cout<<"Yes";
else cout<<"No";
return 0;
}