#include <bits/stdc++.h>
using namespace std;
bool used[1500][1500];
char a[1505][1505];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      cin >> a[i][j];
    }
  }
  int cnt = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      cnt = 0;
      for (int i1 = -1; i1 <= 1; i1++) {
        for (int j1 = -1; j1 <= 1; j1++) {
          if (i1 == 0 and j1 == 0) continue;
          cnt += a[i + i1][j + j1] == '#';
        }
      }
      if (cnt == 8) {
        for (int i1 = -1; i1 <= 1; i1++) {
          for (int j1 = -1; j1 <= 1; j1++) {
            if (i1 == 0 and j1 == 0) continue;
            used[i + i1][j + j1] = 1;
          }
        }
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      if (a[i][j] == '#' and !used[i][j]) return cout << "NO", 0;
    }
  }
  puts("YES");
}
