#define _USE_MATH_DEFINES #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair i_i; typedef pair ll_i; typedef pair d_i; typedef pair ll_ll; typedef pair d_d; struct edge { int v, w; }; ll MOD = 1000000009; ll _MOD = 1000000009; double EPS = 1e-10; bool check(vector& S) { int H = S.size(), W = S[0].length(); for (int dy = 0; dy < H; dy++) for (int dx = 0; dx < W; dx++) { if (dx == 0 && dy == 0) continue; vector s = S; bool ok = true; for (int y = 0; y < H; y++) for (int x = 0; x < W; x++) { if (s[y][x] == '.') continue; if (x + dx >= W || y + dy >= H || s[y + dy][x + dx] == '#') ok = false; s[y][x] = '.'; } } } int main() { int H, W; cin >> H >> W; vector S(H); for (int y = 0; y < H; y++) cin >> S[y]; if (check(S)) { cout << "YES" << endl; return 0; } for (int y = 0; y < H; y++) reverse(S[y].begin(), S[y].end()); if (check(S)) { cout << "YES" << endl; return 0; } cout << "NO" << endl; }