#include <bits/stdc++.h>
using namespace std;
int a[1005][1005], b[1005][1005], n, m, ni, nj;
int dx[10] = {-1, 0, 1};
int dy[10] = {-1, 0, 1};
char c;
int main() {
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      cin >> c;
      if (c == '#') {
        a[i][j] = 1;
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      bool f = true;
      for (int ii = 0; ii < 3; ii++) {
        for (int jj = 0; jj < 3; jj++) {
          if (ii != 1 || jj != 1) {
            ni = i + dx[ii];
            nj = j + dy[jj];
            if (a[ni][nj] == 0) {
              f = false;
            }
          }
        }
      }
      if (f == true) {
        for (int ii = 0; ii < 3; ii++) {
          for (int jj = 0; jj < 3; jj++) {
            if (ii != 1 || jj != 1) {
              ni = i + dx[ii];
              nj = j + dy[jj];
              b[ni][nj] = 1;
            }
          }
        }
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      if (a[i][j] != b[i][j]) {
        cout << "NO";
        return 0;
      }
    }
  }
  cout << "YES";
}
