#include <bits/stdc++.h>
using namespace std;
const int dir[8][2] = {{1, 0},  {0, 1},  {1, 1},   {1, -1},
                       {-1, 0}, {0, -1}, {-1, -1}, {-1, 1}};
int n, m, cnt[1000 + 5][1000 + 5];
char a[1000 + 5][1000 + 5];
void work(int x, int y) {
  bool flag = true;
  for (int i = 0; i < 8; i++) {
    int nx = x + dir[i][0], ny = y + dir[i][1];
    if (a[nx][ny] == '.') flag = false;
  }
  if (flag)
    for (int i = 0; i < 8; i++) {
      int nx = x + dir[i][0], ny = y + dir[i][1];
      cnt[nx][ny]++;
    }
}
bool judge() {
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++)
      if (a[i][j] == '#' && cnt[i][j] == 0) return false;
  return true;
}
int main() {
  cin >> n >> m;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) cin >> a[i][j];
  for (int i = 2; i <= n - 1; i++)
    for (int j = 2; j <= m - 1; j++) work(i, j);
  if (judge())
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
