#include <bits/stdc++.h>
using namespace std;
bool vis[1010][1010];
char info[1010][1010];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%s", info[i] + 1);
    for (int j = 1; j <= m; j++) {
      if (i == 1 || i == n || j == 1 || j == m) vis[i][j] = 1;
      if (info[i][j] == '.')
        for (int p = i - 1; p <= i + 1; p++)
          for (int q = j - 1; q <= j + 1; q++)
            if (!(p == i && q == j)) vis[p][q] = 1;
    }
  }
  for (int i = 0; i <= n + 1; i++) vis[i][0] = vis[i][m + 1] = 1;
  for (int j = 0; j <= m + 1; j++) vis[0][j] = vis[n + 1][j] = 1;
  bool flag = 1;
  int cnt;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      if (info[i][j] == '#') {
        cnt = 0;
        for (int p = i - 1; p <= i + 1; p++)
          for (int q = j - 1; q <= j + 1; q++)
            if (!(p == i && q == j) && vis[p][q] == 1) cnt++;
        if (cnt == 8) {
          flag = 0;
          break;
        }
      }
    }
    if (!flag) break;
  }
  if (flag)
    puts("YES");
  else
    puts("NO");
  return 0;
}
