#include #include #include #include #include #include #include #include #include #include #include using namespace std; #define REP(i,n) for(int i=0; i<(int)(n); i++) #define RREP(i,n) for(int i=(int)n-1; i>=0; i--) #define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i) #define RFOR(i,c) for(__typeof((c).rbegin())i=(c).rbegin();i!=(c).rend();++i) #define ALL(c) (c).begin(), (c).end() typedef long long int ll; typedef pair pii; typedef pair > pipii; typedef vector vi; const int INF = 1e9; const int MOD = 1e9+7; int h, w; bool check(int x, int y, vector g){ REP(i, h){ REP(j, w){ if(g[i][j]){ int dx = i + x, dy = j + y; if(dx < 0 || dy < 0 || dx >= h || dy >= w) return false; if(!g[dx][dy]) return false; g[i][j] = g[dx][dy] = 0; } } } return true; } int main(void){ cin >> h >> w; vector g(h, vi(w, 0)); REP(i, h){ REP(j, w){ char c; cin >> c; if(c == '#') g[i][j] = 1; } } REP(i, 50){ REP(j, 50){ if(!i && !j) continue; if(check(i, j, g)){ cout << "YES" << endl; return 0; } } } cout << "NO" << endl; return 0; }