#include using namespace std; #define FOR(i,a,b) for(int i=(a);i<(b);i++) #define REP(i,n) FOR(i,0,n) #define ALL(v) (v).begin(),(v).end() template inline bool chmax(A &a, B b) { if (a inline bool chmin(A &a, B b) { if (a>b) { a=b; return 1; } return 0; } typedef unsigned long long ull; typedef long long ll; typedef pair pii; typedef pair pll; typedef pair P; const ll INF = 1ll<<29; const ll MOD = 1000000007; const double EPS = 1e-10; int h, w; string maps[50]; bool done[50][50]; int main() { cin >> h >> w; REP(i, h) cin >> maps[i]; bool ans = false; REP(dy, h) REP(dx, w) { if (dx == 0 && dy == 0) continue; REP(i, h) REP(j, w) done[i][j] = maps[i][j] == '.'; bool ok = true; REP(i, h) REP(j, w) { if (done[i][j]) continue; int ny = i + dy, nx = j + dx; bool ng = false; if (!(nx >= 0 && nx < w && ny >= 0 && ny < h)) ng = true; if (!ng && done[ny][nx]) ng = true; if (!ng) done[ny][nx] = true; if (ng) ok = false; } if (ok) ans = true; } puts(ans ? "YES" : "NO"); return 0; }