#include using namespace std; const int BUF = 55; int row, col; char b[BUF][BUF]; void read() { cin >> row >> col; for (int i = 0; i < row; ++i) for (int j = 0; j < col; ++j) cin >> b[i][j]; } void work() { bool exist = false; for (int i = 0; i < row; ++i) for (int j = 0; j < col; ++j) if (b[i][j] == '#') exist = true; if (!exist) { cout << "NO" << endl; return; } for (int dr = 0; dr < row; ++dr) for (int dc = 0; dc < col; ++dc) { if (dr == 0 && dc == 0) continue; bool used[BUF][BUF] = {}; for (int r = 0; r < row; ++r) { for (int c = 0; c < col; ++c) { if (b[r][c] == '#' && !used[r][c]) { if (r + dr < row && c + dc < col && b[r + dr][c + dc] == '#') { used[r][c] = used[r + dr][c + dc] = true; } else { goto _fail; } } } } cout << "YES" << endl; return; _fail:; } cout << "NO" << endl; } int main() { read(); work(); return 0; }