#include <bits/stdc++.h>
using namespace std;
char c[1005][1005], c1[1005][1005];
int main() {
  ios_base::sync_with_stdio(0);
  int n, m;
  cin >> n >> m;
  int k = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cin >> c[i][j];
      c1[i][j] = '.';
    }
  }
  for (int i = 0; i < n - 2; i++) {
    for (int j = 0; j < m - 2; j++) {
      k = 0;
      if (i + 2 < n && j + 2 < m && c[i][j] == '#') {
        for (int p = i; p <= i + 2; p++) {
          for (int s = j; s <= j + 2; s++) {
            if (p == i + 1 && s == j + 1) {
              continue;
            } else {
              if (c[p][s] == '#') {
                k++;
              }
            }
          }
        }
        if (k == 8) {
          for (int p = i; p <= i + 2; p++) {
            for (int s = j; s <= j + 2; s++) {
              if (p == i + 1 && s == j + 1) {
                continue;
              } else {
                c1[p][s] = '#';
              }
            }
          }
        }
      }
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (c[i][j] != c1[i][j]) {
        cout << "NO";
        return 0;
      }
    }
  }
  cout << "YES";
  return 0;
}
