#include <bits/stdc++.h>
using std::cin;
using std::cout;
using std::endl;
using std::max;
using std::min;
using std::queue;
using std::sort;
const int N = 1000;
const int d[][2] = {0, 1, 1, 0, 0, -1, -1, 0, 1, 1, -1, -1, 1, -1, -1, 1};
int n, m;
bool a[N + 3][N + 3];
bool b[N + 3][N + 3];
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      char ch = getchar();
      if (ch == '#')
        a[i][j] = 1;
      else if (ch != '.')
        j--;
    }
  }
  for (int i = 2; i < n; i++) {
    for (int j = 2; j < m; j++) {
      bool ok = 1;
      for (int k = 0; k < 8; k++) {
        if (!a[i + d[k][0]][j + d[k][1]]) ok = 0;
      }
      if (ok) {
        for (int k = 0; k < 8; k++) b[i + d[k][0]][j + d[k][1]] = 1;
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      if (a[i][j] != b[i][j]) {
        printf("NO\n");
        return 0;
      }
    }
  }
  printf("YES\n");
  return 0;
}
