#include <bits/stdc++.h>
using namespace std;
char mp[1005][1005];
char mp2[1005][1005];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < n; i++) cin >> mp[i];
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) mp2[i][j] = '.';
  for (int i = 0; i + 2 < n; i++)
    for (int j = 0; j + 2 < m; j++) {
      int gg = 1;
      if (mp[i][j] != '#') gg = 0;
      if (mp[i + 1][j] != '#') gg = 0;
      if (mp[i + 2][j] != '#') gg = 0;
      if (mp[i][j + 1] != '#') gg = 0;
      if (mp[i][j + 2] != '#') gg = 0;
      if (mp[i + 2][j + 1] != '#') gg = 0;
      if (mp[i + 2][j + 2] != '#') gg = 0;
      if (mp[i + 1][j + 2] != '#') gg = 0;
      if (gg) {
        mp2[i][j] = '#';
        mp2[i + 1][j] = '#';
        mp2[i + 2][j] = '#';
        mp2[i][j + 1] = '#';
        mp2[i][j + 2] = '#';
        mp2[i + 2][j + 1] = '#';
        mp2[i + 2][j + 2] = '#';
        mp2[i + 1][j + 2] = '#';
      }
    }
  int gg = 0;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      if (mp[i][j] != mp2[i][j]) gg = 1;
  if (!gg)
    cout << "YES\n";
  else
    cout << "NO\n";
  return 0;
}
