#include <bits/stdc++.h>
using namespace std;
bool pres[1005][1005];
int grid[1005][1005];
void fill(int x, int y) {
  for (int i = x - 1; i <= x + 1; i++)
    for (int j = y - 1; j <= y + 1; j++) {
      if (i == x && j == y) continue;
      pres[i][j] = true;
    }
}
bool center(int x, int y) {
  for (int i = x - 1; i <= x + 1; i++)
    for (int j = y - 1; j <= y + 1; j++) {
      if (i == x && j == y) continue;
      if (!grid[i][j]) return false;
    }
  return true;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  memset(pres, 0, sizeof(pres));
  int n, m, i, j;
  cin >> n >> m;
  for (i = 1; i <= n; i++) {
    string s;
    cin >> s;
    for (j = 1; j <= m; j++)
      if (s[j - 1] == '.')
        grid[i][j] = 0;
      else
        grid[i][j] = 1;
  }
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= m; j++) {
      if (center(i, j)) fill(i, j);
    }
  }
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= m; j++)
      if (grid[i][j] && !pres[i][j]) {
        cout << "NO\n";
        return 0;
      }
  }
  cout << "YES\n";
  return 0;
}
