#include <bits/stdc++.h>
const int MAXN = 1e5 + 10;
using namespace std;
char a[1010][1010], b[1010][1010];
int main() {
  int n, m, flag;
  cin >> n >> m;
  memset(a, '.', sizeof(a));
  memset(b, '.', sizeof(b));
  flag = 1;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cin >> a[i][j];
    }
  }
  for (int i = 1; i < n - 1; i++) {
    for (int j = 1; j < m - 1; j++) {
      if (a[i][j - 1] == '#' && a[i][j + 1] == '#' && a[i - 1][j - 1] == '#' &&
          a[i - 1][j] == '#' && a[i - 1][j + 1] == '#' &&
          a[i + 1][j - 1] == '#' && a[i + 1][j] == '#' &&
          a[i + 1][j + 1] == '#') {
        b[i][j - 1] = '#';
        b[i][j + 1] = '#';
        b[i - 1][j - 1] = '#';
        b[i - 1][j] = '#';
        b[i - 1][j + 1] = '#';
        b[i + 1][j - 1] = '#';
        b[i + 1][j] = '#';
        b[i + 1][j + 1] = '#';
      }
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (a[i][j] != b[i][j]) {
        flag = 0;
        break;
      }
    }
  }
  if (flag)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
