#include <bits/stdc++.h>
using namespace std;
int a[1001][1001];
int b[1001][1001] = {0};
int dx[] = {-1, 0, 1, -1, 1, -1, 0, 1};
int dy[] = {-1, -1, -1, 0, 0, 1, 1, 1};
bool isOk(int x, int y) {
  for (int i = 0; i < 8; i++) {
    if (a[x + dx[i]][y + dy[i]] == 0) return false;
  }
  return true;
}
int main() {
  int n, m;
  char c;
  int flag = 1;
  cin >> n >> m;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) {
      cin >> c;
      if (c == '.')
        a[i][j] = 0;
      else
        a[i][j] = 1;
    }
  for (int i = 1; i < n - 1; i++) {
    for (int j = 1; j < m - 1; j++) {
      if (isOk(i, j)) {
        for (int k = 0; k < 8; k++) {
          b[i + dx[k]][j + dy[k]] = 1;
        }
      }
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (a[i][j] != b[i][j]) {
        flag = 0;
        break;
      }
    }
    if (!flag) break;
  }
  if (!flag)
    cout << "NO\n";
  else
    cout << "YES\n";
  return 0;
}
