#include <bits/stdc++.h>
using namespace std;
int n, m;
char g[1005][1005];
char col[1005][1005];
template <typename T>
struct SegmentTree {};
void input() {
  cin >> n >> m;
  string s;
  for (int i = 1; i <= n; i++) {
    cin >> s;
    for (int j = 1; j <= m; j++) {
      g[i][j] = s[j - 1];
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      col[i][j] = '.';
    }
  }
  for (int i = 2; i < n; i++) {
    for (int j = 2; j < m; j++) {
      if (g[i - 1][j - 1] == '#' && g[i - 1][j + 1] == '#' &&
          g[i + 1][j - 1] == '#' && g[i + 1][j + 1] == '#' &&
          g[i - 1][j] == '#' && g[i][j - 1] == '#' && g[i + 1][j] == '#' &&
          g[i][j + 1] == '#') {
        col[i - 1][j - 1] = '#';
        col[i - 1][j + 1] = '#';
        col[i + 1][j - 1] = '#';
        col[i + 1][j + 1] = '#';
        col[i - 1][j] = '#';
        col[i][j - 1] = '#';
        col[i + 1][j] = '#';
        col[i][j + 1] = '#';
      }
    }
  }
  bool check = true;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      check &= col[i][j] == g[i][j];
    }
  }
  if (check)
    cout << "YES";
  else
    cout << "NO";
}
void solve() {}
int main(int argc, char** argv) {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  input();
  return 0;
}
