#include using namespace std; using uint = unsigned int; using ll = long long; using ull = unsigned long long; template using V = vector; template using VV = V>; template using VVV = V>; template using VVVV = VV>; #define rep(i,n) for(ll i=0ll;i void chmin(T& t, const U& u) { if (t > u) t = u; } template void chmax(T& t, const U& u) { if (t < u) t = u; } // cin.tie(nullptr); // ios::sync_with_stdio(false); // cout << fixed << setprecision(20); void solve(){ ll h,w; cin >> h >> w; V v(h); rep(i,h) cin >> v[i]; string ans = "NO"; rep(i,h) rep(j,w) if(i+j){ ll f = 1; VV p(h, V(w, 0)); rep(x, h) rep(y, w) if(v[x][y] == '#' && !p[x][y]){ p[x][y] = 1; if((x+i>=h || y+j>=w) || v[x+i][y+j] == '.') f = 0; else p[x+i][y+j] = 2; } if(f) ans = "YES"; } rep(i,h) rep(j,w) if(i+j){ ll f = 1; VV p(h, V(w, 0)); rep(x, h) rep(y, w) if(v[x][y] == '#' && !p[x][y]){ p[x][y] = 1; if((x-i<0 || y+j>=w) || v[x-i][y+j] == '.') f = 0; else p[x-i][y+j] = 2; } if(f) ans = "YES"; } cout << ans << endl; } int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); int t=1; // cin >> t; rep(i,t) solve(); }