#include using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int H, W; cin >> H >> W; vector S(H); for (int i = 0; i < H; i++) { cin >> S[i]; } int count = 0; for (int i = 0; i < H; i++) { for (int j = 0; j < W; j++) { if (S[i][j] == '#') count++; } } if (count == 0) { cout << "NO" << '\n'; return 0; } for (int i = 0; i < H; i++) { for (int j = 1 - W; j < W; j++) { if (i == 0 && j == 0) continue; auto T = S; int c = 0; for (int y = 0; y < H; y++) { for (int x = 0; x < W; x++) { if (T[y][x] != '#') continue; if (i + y < H && j + x >= 0 && j + x < W && T[i + y][j + x] == '#') { T[y][x] = T[i + y][j + x] = '.'; c += 2; } } } if (count == c) { cout << "YES" << '\n'; return 0; } } } cout << "NO" << '\n'; return 0; }