#include using namespace std; const int N = 55; string s[N]; bool vis[N][N]; int main() { ios::sync_with_stdio(0); int n, m; cin >> n >> m; for(int i = 0; i < n; i ++) cin >> s[i]; bool f = 0; for(int t : {0, 1}) { for(int i = 0; i <= n; i ++) for(int j = 0; j <= m; j ++) if(i + j > 0) { bool t = 1; int cnt = 0; memset(vis, 0, sizeof vis); for(int x = 0; x < n; x ++) for(int y = 0; y < m; y ++) if(s[x][y] == '#' && !vis[x][y]) { vis[x][y] = 1; cnt ++; int tx = x + i, ty = y + j; if(tx >= 0 && tx < n && ty >= 0 && ty < m && s[tx][ty] == '#') { vis[tx][ty] = 1; } else { t = 0; } } f |= (t && cnt > 0); } reverse(s, s + n); } cout << (f ? "YES" : "NO") << '\n'; }