#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 + dy == 0) continue; int cnt = 0; REP(i, h) REP(j, w) { done[i][j] = maps[i][j] == '.'; if (!done[i][j]) cnt++; } bool ok = true; if (cnt < 2) ok = false; REP(i, h) REP(j, w) { if (done[i][j]) continue; int ny = i + dy, nx = j + dx; bool ng = false; if (!(nx < w && ny < h)) ng = true; else if (done[ny][nx]) ng = true; else done[ny][nx] = true; if (ng) ok = false; } if (ok) ans = true; } puts(ans ? "YES" : "NO"); return 0; }