#include #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; using ll = long long; using pii = pair; char s[105][105]; int main() { int h, w; cin >> h >> w; rep(i, 105) rep(j, 105) s[i][j] = '.'; rep(i, h) rep(j, w) cin >> s[i][j]; rep(dy, h) rep(dx, w) { if (dy == 0 && dx == 0) continue; char c[105][105]; rep(i, 105) rep(j, 105) c[i][j] = s[i][j]; rep(y, h) rep(x, w) { if (c[y][x] == '#' && c[y + dy][x + dx] == '#') { c[y][x] = 'r'; c[y + dy][x + dx] = 'b'; } } bool ok = true; rep(y, h) rep(x, w) { if (c[y][x] == '#') ok = false; if (c[y][x] == 'r' && c[y + dy][x + dx] != 'b') ok = false; if (c[y][x] == 'b' && c[y + dy][x + dx] != '.') ok = false; } if (ok) { cout << "YES" << endl; return 0; } } cout << "NO" << endl; return 0; }