#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:1024000000")
#pragma GCC target(arch = corie7 - acx)
#pragma GCC optimize(2)
using namespace std;
int n, m;
char ch[2000][2000];
bool b[2000][2000];
bool ok(int x, int y) {
  if (ch[x][y] == '.') return false;
  if (ch[x + 1][y] == '.') return false;
  if (ch[x + 2][y] == '.') return false;
  if (ch[x][y + 1] == '.') return false;
  if (ch[x][y + 2] == '.') return false;
  if (ch[x + 1][y + 2] == '.') return false;
  if (ch[x + 2][y + 1] == '.') return false;
  if (ch[x + 2][y + 2] == '.') return false;
  return true;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) scanf("%s", ch[i] + 1);
  for (int i = 1; i <= n - 2; i++)
    for (int j = 1; j <= m - 2; j++)
      if (ok(i, j)) {
        b[i][j] = true;
        b[i + 1][j] = true;
        b[i + 2][j] = true;
        b[i][j + 1] = true;
        b[i][j + 2] = true;
        b[i + 1][j + 2] = true;
        b[i + 2][j + 1] = true;
        b[i + 2][j + 2] = true;
      }
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++)
      if (ch[i][j] == '#' && !b[i][j]) return puts("NO"), 0;
  printf("YES");
  return 0;
}
