#include using namespace std; #define REP(i,n) for(int i=0; i<(int)(n); i++) #define FOR(i,b,e) for (int i=(int)(b); i<(int)(e); i++) #define ALL(x) (x).begin(), (x).end() const double PI = acos(-1); int h, w; vector bd; bool check() { int c = 0; REP (i, h) REP (j, w) c += bd[i][j] == '#'; if (!c) return false; for (int y = 0; y < h; y++) { for (int x = 0; x < w; x++) { int r = 0, b = 0; vector tmp = bd; for (int i = 0; i+y < h; i++) { for (int j = 0; j+x < w; j++) { if (tmp[i][j] == '#') { if (tmp[i+y][j+x] == '#' && x+y > 0) { tmp[i][j] = 'r'; tmp[i+y][j+x] = 'b'; ++r, ++b; } } } } if (r == b && r + b == c) { return true; } } } return false; } int main() { ios_base::sync_with_stdio(0); cin.tie(0); cin >> h >> w; REP (i, h) { string s; cin >> s; bd.push_back(s); } if (check()) cout << "YES" << endl; else cout << "NO" << endl; return 0; }