#include using namespace std; typedef long long ll; typedef vector VI; typedef vector VVI; typedef vector VL; typedef vector VVL; typedef pair PII; #define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i) #define REP(i, n) FOR(i, 0, n) #define ALL(x) x.begin(), x.end() #define MOD 1000000007 #define INF (1LL << 25) // 33554432 #define PI 3.14159265359 #define EPS 1e-12 //#define int ll signed main(void) { int h, w; string s[55], t[55]; cin >> h >> w; REP(i, h) cin >> s[i]; REP(i, h) REP(j, w) { REP(k, h) t[k] = s[k]; bool flag = false; REP(k, h) { REP(l, w) { if (t[k][l] == '#') { t[k][l] = 'R'; if (k + i < h && l + j < w && t[k + i][l + j] == '#') { t[k + i][l + j] = 'B'; } else { flag = true; } } if(flag) break; } if(flag) break; } if(!flag) { bool a = true; REP(k, h) REP(l, w) { if(t[k][l] == '#') a = false; } if(a) { cout << "YES" << endl; //REP(i, h) cout << t[i] << endl; return 0; } } } cout << "NO" << endl; return 0; }