#include <bits/stdc++.h>
using namespace std;
using namespace std;
vector<pair<long long, long long> > v;
int n, m;
char grid[1005][1005];
bool hit[1005][1005];
int dx[8] = {0, 0, -1, 1, 1, -1, -1, 1};
int dy[8] = {1, -1, 0, 0, 1, -1, 1, -1};
bool valid(int i, int j) { return i >= 0 && i < n && j >= 0 && j < m; }
int main() {
  cin >> n >> m;
  for (int i = 0; i < n; ++i) {
    scanf("%s", grid[i]);
  }
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      bool ok = 1;
      int b = 0;
      for (int k = 0; k < 8; ++k) {
        int xc = i + dx[k], yc = j + dy[k];
        ok &= valid(xc, yc);
        if (valid(xc, yc) && grid[xc][yc] == '#') {
          b++;
        }
      }
      if (ok && b == 8) {
        for (int k = 0; k < 8; ++k) {
          int xc = i + dx[k], yc = j + dy[k];
          hit[xc][yc] = 1;
        }
      }
    }
  }
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      if (grid[i][j] == '#' && !hit[i][j]) {
        cout << "NO\n";
        return 0;
      }
    }
  }
  cout << "YES\n";
}
