#include <bits/stdc++.h>
using namespace std;
char a[55][55];
void DFS(int y, int x) {
  if (a[y][x] != '#')
    return;
  else {
    a[y][x] = '.';
    DFS(y, x + 1);
    DFS(y + 1, x);
    DFS(y, x - 1);
    DFS(y - 1, x);
  }
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int j = 1; j <= n; j++)
    for (int o = 1; o <= m; o++) a[j][o] = '.';
  for (int j = 1; j <= n; j++)
    for (int o = 1; o <= m; o++) cin >> a[j][o];
  int ans = 0;
  for (int j = 1; j <= n; j++)
    for (int o = 1; o <= m; o++)
      if (a[j][o] == '#') {
        ans++;
        DFS(j, o);
      }
  if (ans == 1)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}
