#include<bits/stdc++.h> using namespace std; #define all(v) v.begin(),v.end() using ll = long long; using ull = unsigned long long; using vll=vector<ll>; using vvll = vector<vector<ll>>; int main(){ ll H,W; cin >>H>>W; vector<vector<char>> S(H,vector<char>(W)); for(int i=0;i<H;i++){ for(int j=0;j<W;j++){ cin >>S[i][j]; } } for(int i=0;i<H;i++){ for(int j=0;j<W;j++){ if(i==0&&j==0)continue; vvll A(H,vll(W,-1)); bool a=true; for(int i2=0;i2<H;i2++){ for(int j2=0;j2<W;j2++){ if(S[i2][j2]=='.'||A[i2][j2]!=-1)continue; A[i2][j2]=1; ll i3=i2+i,j3=j2+j; if(!(0<=i3&&i3<H&&0<=j3&&j3<W)){ a=false; break; } if(S[i3][j3]=='.')a=false; A[i3][j3]=0; } } if(a){ cout << "YES" << endl; return 0; } } } cout << "NO" << endl; }