#include <bits/stdc++.h>
using namespace std;
int n, m;
char a[1005][1005];
int nextt[8][2] = {{-1, -1}, {-1, 0}, {-1, 1}, {0, -1},
                   {0, 1},   {1, -1}, {1, 0},  {1, 1}};
int main() {
  int ans = 0, cnt = 0;
  scanf("%d %d", &n, &m);
  for (int i = 0; i < n; i++) {
    scanf("%s", a[i]);
    for (int j = 0; j < m; j++) {
      if (a[i][j] == '#') ans++;
    }
  }
  for (int i = 1; i < n - 1; i++) {
    for (int j = 1; j < m - 1; j++) {
      int co = 0;
      for (int k = 0; k < 8; k++) {
        int tx = i + nextt[k][0];
        int ty = j + nextt[k][1];
        if (a[tx][ty] == '#' || a[tx][ty] == '1')
          co++;
        else
          continue;
      }
      if (co == 8) {
        for (int k = 0; k < 8; k++) {
          int tx = i + nextt[k][0];
          int ty = j + nextt[k][1];
          if (a[tx][ty] == '#') cnt++;
          a[tx][ty] = '1';
        }
      }
    }
  }
  if (ans == cnt)
    printf("YES\n");
  else
    printf("NO\n");
  return 0;
}
