#include <bits/stdc++.h>
using namespace std;
char arr[1010][1010];
void check(int x, int y) {
  for (int i = 0; i < 3; i++) {
    for (int j = 0; j < 3; j++) {
      if (i == 1 && j == 1) continue;
      if (arr[x + i][y + j] == '.') return;
    }
  }
  for (int i = 0; i < 3; i++) {
    for (int j = 0; j < 3; j++) {
      if (i == 1 && j == 1) continue;
      arr[x + i][y + j] = '@';
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m;
  cin >> n >> m;
  for (long long int i = 1; i < n + 1; i++)
    for (long long int j = 1; j < m + 1; j++) cin >> arr[i][j];
  for (int i = 1; i <= n - 2; i++)
    for (int j = 1; j <= m - 2; j++) check(i, j);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++)
      if (arr[i][j] == '#') {
        cout << "NO";
        return 0;
      }
  cout << "YES";
  return 0;
}
