#include using namespace std; #define ALL(x) begin(x),end(x) #define rep(i,n) for(int i=0;i<(n);i++) #define debug(v) cout<<#v<<":";for(auto x:v){cout<bool chmax(T &a,const T &b){if(abool chmin(T &a,const T &b){if(b ostream &operator<<(ostream &os,const vector&v){ for(int i=0;i<(int)v.size();i++) os< istream &operator>>(istream &is,vector&v){ for(T &x:v)is>>x; return is; } signed main(){ int h,w;cin>>h>>w; vector s(h); cin>>s; for(int si=0;si> c(h,vector(w,0)); bool f=true; rep(i,h)rep(j,w)if(f){ if(s[i][j]=='.'){ c[i][j]=3; continue; } if(c[i][j]) continue; if(i+si>=h or j+sj>=w){ f=false; break; } if(s[i+si][j+sj]=='.'){ f=false; break; } c[i][j]=0; c[i+si][j+sj]=1; } if(f){ cout<<"YES"<