#include <bits/stdc++.h>
using namespace std;
int n, m;
char grid[1005][1005];
char myGrid[1005][1005];
bool isFilled(int i, int j) {
  for (int x = i - 1; x <= i + 1; x++) {
    for (int y = j - 1; y <= j + 1; y++) {
      if ((x != i || y != j) && grid[x][y] == '.') return 0;
    }
  }
  return 1;
}
void fillMine(int i, int j) {
  for (int x = i - 1; x <= i + 1; x++) {
    for (int y = j - 1; y <= j + 1; y++) {
      if (x != i || y != j) myGrid[x][y] = '#';
    }
  }
}
int main() {
  while (cin >> n >> m) {
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        cin >> grid[i][j];
        myGrid[i][j] = '.';
      }
    }
    for (int i = 1; i + 1 < n; i++) {
      for (int j = 1; j + 1 < m; j++) {
        if (isFilled(i, j)) {
          fillMine(i, j);
        }
      }
    }
    bool yes = 1;
    for (int i = 0; i < n && yes; i++) {
      for (int j = 0; j < m && yes; j++) {
        if (grid[i][j] != myGrid[i][j]) {
          yes = 0;
        }
      }
    }
    if (yes)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
