#include using namespace std; #undef _P #define _P(...) (void)printf(__VA_ARGS__) #define FOR(i,a,b) for (int i = (a); i < (b); i++) #define RFOR(i,a,b) for (int i = (b)-1; i >= (a); i--) #define REP(i,n) for (int i = 0; i < (n); i++) #define RREP(i,n) for (int i = (n)-1; i >= 0; i--) #define ALL(x) (x).begin(), (x).end() #define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++) #define MP(x,y) make_pair((x), (y)) #define MIN(a,b) (a < b ? a : b) #define MAX(a,b) (a > b ? a : b) #define AMIN(a,b) if(b < a) (a) = (b) #define AMAX(a,b) if(b > a) (a) = (b) #define ZERO(a) memset(a,0,sizeof(a)) #define MINUS(a) memset(a,0xff,sizeof(a)) #define bitcount(b) __builtin_popcount(b) #define GCD(a,b) (__gcd(a,b)) #define GCD3(a,b,c) (GCD(GCD(a,b), c)) #define LCM(a,b) (a/GCD(a,b)*b) #define LCM3(a,b,c) LCM(LCM(a,b),c) #define MOD 1000000007 typedef long long ll; // ------------------------------------- int H, W; string S[50]; bool m[50][50]; bool can(int dy, int dx) { ZERO(m); REP(y, H) { REP(x, W) { if (S[y][x] == '#') m[y][x] = true; } } REP(y, H) { REP(x, W) { if (m[y][x]) { if (y + dy >= H || x + dx >= W) return false; if (!m[y + dy][x + dx]) return false; m[y][x] = m[y + dy][x + dx] = false; } } } return true; } int main() { cin >> H >> W; REP(i, H) cin >> S[i]; REP(dy, H) { REP(dx, W) { if (dy == 0 && dx == 0) continue; if (can(dy, dx)) { cout << "YES" << endl; return 0; } } } cout << "NO" << endl; return 0; }