#include using namespace std; #include //using namespace atcoder; using ll = long long; using ull = unsigned long long; using i128 = __int128_t; using u128 = unsigned __int128_t; using mint = atcoder::static_modint<998244353>; const int mod = 998244353; #include mt19937_64 rng(std::chrono::steady_clock::now().time_since_epoch().count()); int dx[8] = {-1, 1, 0, 0, -1, -1, 1, 1}; int dy[8] = {0, 0, -1, 1, -1, 1, -1, 1}; template bool chmin(T& a, const T& b){ if (b < a){ a = b; return true; } else { return false; } } template bool chmax(T& a, const T& b){ if (a < b){ a = b; return true; } else { return false; } } void solve(){ int h, w; cin >> h >> w; vector s(h); for (int i = 0; i < h; i++){ cin >> s[i]; } for (int i = 1; i <= h; i++){ for (int j = 1; j <= w; j++){ vector> used(h, vector (w, false)); bool ok = true; for (int a = 0; a < h; a++){ for (int b = 0; b < w; b++){ if (s[a][b] == '#' && !used[a][b]){ int x = a + i, y = b + j; if (x >= h || y >= w){ ok = false; } else { if (s[x][y] == '#'){ used[x][y] = true; } else { ok = false; } } } } } if (ok){ cout << "YES" << '\n'; return; } } } cout << "NO" << '\n'; }; int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); int t = 1; while(t--){ cout << fixed << setprecision(15); solve(); } }