#include <bits/stdc++.h>
using namespace std;
int solution(std::vector<std::vector<bool>> grid) { return 0; }
int main(void) {
  int H, W;
  cin >> H >> W;
  std::vector<std::vector<int>> grid(W);
  std::vector<int> gridH(H);
  char a;
  for (int i = 0; i < W; i++) {
    for (int j = 0; j < H; j++) {
      cin >> a;
      cerr << "a"
           << ":" << a << endl;
      gridH.at(j) = (a == '.') ? 0 : 1;
      grid.at(i) = gridH;
      cerr << "gridH.at(j)"
           << ":" << gridH.at(j) << endl;
    }
  }
  int ans = 1;
  int r, l, u, d;
  for (int i = 0; i < W; i++) {
    for (int j = 0; j < H; j++) {
      r = (j == H - 1) ? 0 : grid[i][j + 1];
      l = (j == 0) ? 0 : grid[i][j - 1];
      u = (i == 0) ? 0 : grid[i - 1][j];
      d = (i == W - 1) ? 0 : grid[i + 1][j];
      cerr << "i"
           << ":" << i << endl;
      cerr << "j"
           << ":" << j << endl;
      cerr << "grid[i][j]"
           << ":" << grid[i][j] << endl;
      if (r + l + u + d == 0) {
        ans = 0;
      }
    }
  }
  cout << ((ans == 1) ? "YES" : "NO") << endl;
}
