#include using namespace std; using ll = long long; int H, W; vector S; bool inside(int x, int y){ return 0 <= x && x < H && 0 <= y && y < W; } int dx[4] = {1, 1, -1, -1}; int dy[4] = {1, -1, -1, 1}; int main(void){ ios::sync_with_stdio(false); cin.tie(nullptr); cin >> H >> W; S.resize(H); auto power = vector>>(H + 1, vector>(W + 1, vector(2, 0))); for(int i = 0;i < H;i++)cin >> S[i]; using pp = pair>; queue que; for(int i = 0;i < H;i++){ for(int j = 0;j < W;j++){ if(S[i][j] == '.')continue; { int c = 0; for(int d = 0;d < 4;d++){ int x = i + dx[d], y = j + dy[d]; if(!inside(x, y))continue; if(S[x][y] == '#')c++; } if(c != 4)continue; } int l = 0, r = max(H, W) + 1; while(r - l > 1){ int m = (l + r) / 2; int c = 0; for(int d = 0;d < 4;d++){ int x = i + dx[d] * m, y = j + dy[d] * m; if(!inside(x, y))continue; if(S[x][y] == '#')c++; } if(c == 4)l = m; else r = m; } power[i - l][j - l][0]++; power[i + l + 1][j + l + 1][0]--; power[i - l][j + l][1]++; power[i + l + 1][j - l + 1][1]--; } } for(int x = 0;x < H;x++){ for(int y = 0;y < W;y++){ for(int m = 0;m < 2;m++){ int nx = x + dx[m], ny = y + dy[m]; if(!inside(nx, ny))continue; power[nx][ny][m] += power[x][y][m]; } } } bool f = true; for(int x = 0;x < H;x++){ for(int y = 0;y < W;y++){ bool g = false; for(int m = 0;m < 2;m++){ if(power[x][y][m] > 0)g = true; } f &= g; } } cout << (f ? "Yes\n" : "No\n"); return 0; }