#include <bits/stdc++.h>
using namespace std;
inline int read() {
  unsigned int f = 1, num = 0;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) num = (num << 1) + (num << 3) + ch - '0', ch = getchar();
  return num * f;
}
char a[5003][5003];
char x[5003][5003];
void check(int i, int j) {
  if (a[i - 1][j - 1] == '#' && a[i - 1][j] == '#' && a[i - 1][j + 1] == '#' &&
      a[i][j - 1] == '#' && a[i][j + 1] == '#' && a[i + 1][j - 1] == '#' &&
      a[i + 1][j] == '#' && a[i + 1][j + 1] == '#')
    for (int xx = i - 1; xx <= i + 1; xx++)
      for (int y = j - 1; y <= j + 1; y++)
        if (xx != i || y != j) x[xx][y] = '#';
}
int main() {
  int n = read(), m = read();
  for (int i = 1; i <= n; i++) scanf("%s", a[i] + 1);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) x[i][j] = '.';
  for (int i = 2; i < n; i++)
    for (int j = 2; j < m; j++) check(i, j);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++)
      if (x[i][j] != a[i][j]) puts("NO"), exit(0);
  puts("YES");
  return 0;
}
