#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e3 + 5;
char b[MAX][MAX];
bool mk[MAX][MAX];
bool good(int p, int k) {
  for (int i = -1; i < 2; ++i)
    for (int j = -1; j < 2; ++j)
      if ((i != 0 || j != 0) && b[p + i][k + j] != '#') return 0;
  return 1;
}
void chk(int p, int k) {
  for (int i = 0; i < 3; ++i)
    for (int j = 0; j < 3; ++j)
      if (i != 1 || j != 1) mk[p + i][k + j] = 1;
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; ++i) scanf("%s", b[i]);
  for (int i = 1; i < n - 1; ++i)
    for (int j = 1; j < m - 1; ++j)
      if (good(i, j)) chk(i - 1, j - 1);
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < m; ++j)
      if ((b[i][j] == '#' && !mk[i][j]) || (b[i][j] == '.' && mk[i][j]))
        return printf("NO\n"), 0;
  printf("YES\n");
  return 0;
}
