#include "bits/stdc++.h" using namespace std; using ll = long long; using ld = long double; using P = pair; constexpr ld EPS = 1e-12; constexpr int INF = numeric_limits::max() / 2; constexpr int MOD = 1e9 + 7; int main() { cin.tie(0); ios::sync_with_stdio(false); int H, W; cin >> H >> W; vector s(H); bool check = true; for (int i = 0; i < H; i++) { cin >> s[i]; for (int j = 0; j < W; j++) if (s[i][j] == '#') check = false; } if (check) { cout << "NO" << endl; return 0; } bool f = false; vector> used(H, vector(W, false)); for (int dx = 0; dx < H; dx++) { for (int dy = 0; dy < W; dy++) { if (dx == 0 && dy == 0) continue; for (int i = 0; i < H; i++) { for (int j = 0; j < W; j++) { if (s[i][j] == '.') used[i][j] = true; else used[i][j] = false; } } for (int i = 0; i < H; i++) { for (int j = 0; j < W; j++) { if (used[i][j]) continue; int nx = i + dx, ny = j + dy; if (nx < 0 || H <= nx || ny < 0 || W <= ny) continue; if (used[nx][ny]) continue; used[i][j] = used[nx][ny] = true; } } bool tmp = true; for (int i = 0; i < H; i++) { for (int j = 0; j < W; j++) { if (!used[i][j]) tmp = false; } } if (tmp) f = true; } } for (int dx = 0; dx < H; dx++) { for (int dy = -W + 1; dy <= 0; dy++) { if (dx == 0 && dy == 0) continue; for (int i = 0; i < H; i++) { for (int j = 0; j < W; j++) { if (s[i][j] == '.') used[i][j] = true; else used[i][j] = false; } } for (int i = 0; i < H; i++) { for (int j = W - 1; j >= 0; j--) { if (used[i][j]) continue; int nx = i + dx, ny = j + dy; if (nx < 0 || H <= nx || ny < 0 || W <= ny) continue; if (used[nx][ny]) continue; used[i][j] = used[nx][ny] = true; } } bool tmp = true; for (int i = 0; i < H; i++) { for (int j = 0; j < W; j++) { if (!used[i][j]) tmp = false; } } if (tmp) f = true; } } cout << (f ? "YES" : "NO") << endl; }