#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:102400000,102400000")
using namespace std;
const int maxn = 5e3 + 10;
const int inf = 0x3f3f3f3f;
const long long llinf = 1e17 + 10;
const long long mod = 1e9 + 7;
char mp[1100][1100];
int vis[1100][1100];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%s", &mp[i] + 1);
  }
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      if (mp[i][j - 1] == '#' && mp[i - 1][j] == '#' && mp[i + 1][j] == '#' &&
          mp[i][j + 1] == '#' && mp[i + 1][j + 1] == '#' &&
          mp[i + 1][j - 1] == '#' && mp[i - 1][j - 1] == '#' &&
          mp[i - 1][j + 1] == '#') {
        vis[i][j - 1] = 1;
        vis[i - 1][j] = 1;
        vis[i + 1][j] = 1;
        vis[i][j + 1] = 1;
        vis[i + 1][j + 1] = 1;
        vis[i + 1][j - 1] = 1;
        vis[i - 1][j - 1] = 1;
        vis[i - 1][j + 1] = 1;
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      if (vis[i][j] == 0 && mp[i][j] == '#') ans = 1;
    }
  }
  if (ans == 1)
    printf("NO\n");
  else
    printf("YES\n");
}
