#include <bits/stdc++.h>
using namespace std;
char ch[1009][1009];
int dx[] = {-1, 0, -1, -1, 0, +1, +1, +1};
int dy[] = {0, -1, -1, +1, +1, +1, 0, -1};
int alll(int i, int j) {
  for (int k = 0; k < 8; k++) {
    int x = i + dx[k];
    int y = j + dy[k];
    if (ch[x][y] == '.') return 0;
  }
  return 1;
}
int main() {
  int i, j, k, l, m, n, p, q, x, y;
  while (cin >> n >> m) {
    map<pair<int, int>, int> mp;
    getchar();
    for (i = 0; i < n; i++) {
      cin >> ch[i];
    }
    for (i = 1; i < n - 1; i++) {
      for (j = 1; j < m - 1; j++) {
        if (alll(i, j) == 1) {
          for (k = 0; k < 8; k++) {
            x = i + dx[k];
            y = j + dy[k];
            mp[pair<int, int>(x, y)] = 1;
          }
        }
      }
    }
    for (i = 0; i < n; i++) {
      for (j = 0; j < m; j++)
        if (ch[i][j] == '#' && mp[pair<int, int>(i, j)] == 0) {
          cout << "NO\n";
          return 0;
        }
    }
    cout << "YES\n";
  }
  return 0;
}
