#include <bits/stdc++.h>
using namespace std;
char mp[1005][1005];
int n, m;
bool fix(int x, int y) {
  if (mp[x][y] == '.') return false;
  mp[x][y] = '-';
  return true;
}
bool check(int x, int y) {
  if (x + 2 >= n || y + 2 >= m) return false;
  if (!fix(x, y) || !fix(x + 1, y) || !fix(x + 2, y) || !fix(x, y + 1) ||
      !fix(x + 2, y + 1) || !fix(x, y + 2) || !fix(x + 1, y + 2) ||
      !fix(x + 2, y + 2))
    return false;
  return true;
}
void tryFix(int x, int y) {
  if (x + 2 >= n || y + 2 >= m) return;
  if (mp[x][y] != '.' && mp[x + 1][y] != '.' && mp[x + 2][y] != '.' &&
      mp[x][y + 1] != '.' && mp[x + 2][y + 1] != '.' && mp[x][y + 2] != '.' &&
      mp[x + 1][y + 2] != '.' && mp[x + 2][y + 2] != '.') {
    mp[x][y] = '-';
    mp[x + 1][y] = '-';
    mp[x + 2][y] = '-';
    mp[x][y + 1] = '-';
    mp[x + 2][y + 1] = '-';
    mp[x][y + 2] = '-';
    mp[x + 1][y + 2] = '-';
    mp[x + 2][y + 2] = '-';
  }
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; ++i) {
    scanf("%s", mp[i]);
  }
  bool ok = true;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      if (mp[i][j] == '#') {
        if (!check(i, j)) {
          ok = false;
          goto el;
        }
      } else if (mp[i][j] == '-') {
        tryFix(i, j);
      }
    }
  }
el:
  if (ok) {
    printf("YES\n");
  } else {
    printf("NO\n");
  }
  return 0;
}
