#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
const int L = 1e5 + 7;
map<long long, long long> counter;
long long fastexpo(long long x, long long y, long long m) {
  long long temp = 1;
  while (y > 0) {
    if (y & 1) temp = ((temp % m) * (x % m)) % m;
    x = ((x % m) * (x % m)) % m;
    y >>= 1;
  }
  return temp;
}
bool done[1002][1002];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m;
  cin >> n >> m;
  string s[1002];
  for (int i = 0; i < n; ++i) cin >> s[i];
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      if (i + 2 >= n || j + 2 >= m) continue;
      if (s[i][j] == '.' || s[i + 1][j] == '.' || s[i + 2][j] == '.' ||
          s[i][j + 1] == '.' || s[i + 2][j + 1] == '.' || s[i][j + 2] == '.' ||
          s[i + 1][j + 2] == '.' || s[i + 2][j + 2] == '.')
        continue;
      done[i][j] = 1;
      done[i + 1][j] = 1;
      done[i + 2][j] = 1;
      done[i][j + 1] = 1;
      done[i + 2][j + 1] = 1;
      done[i][j + 2] = 1;
      done[i + 1][j + 2] = 1;
      done[i + 2][j + 2] = 1;
    }
  }
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      if (s[i][j] == '#' && !done[i][j]) {
        cout << "NO";
        return 0;
      }
    }
  }
  cout << "YES";
  return 0;
}
