#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
const long long MOD1 = 998244353;
const long long MIN_LL = -1e18;
const long long MAX_LL = 1e18;
const int MAX_INT = 1e9;
const int MIN_INT = -1e9;
const long double pie = 3.1415926535;
long long fpow(long long n, long long p) {
  ;
  long long m = 1;
  while (p) {
    if (p % 2) m *= n;
    p >>= 1;
    n *= n;
  }
  return m;
}
long long mfpow(long long n, long long p, long long M) {
  long long m = 1;
  n %= M;
  while (p) {
    if (p % 2) m = (m * n) % M;
    n = (n * n) % M;
    p >>= 1;
  }
  return m % M;
}
template <class T>
inline ostream& operator<<(ostream& o, vector<T> v) {
  for (auto i : v) o << i << " ";
  return o;
};
template <class T>
inline ostream& operator<<(ostream& o, set<T> s) {
  for (auto i : s) o << i << " ";
  return o;
}
template <class T>
inline ostream& operator<<(ostream& o, multiset<T> s) {
  for (auto i : s) cout << i << " ";
  return o;
}
template <class T1, class T2>
inline ostream& operator<<(ostream& o, pair<T1, T2> p) {
  o << p.first << " " << p.second << "\n";
  return o;
}
template <class T1, class T2>
inline ostream& operator<<(ostream& o, map<T1, T2> m) {
  for (auto p : m) o << p.first << " " << p.second << "\n";
  return o;
}
const vector<long long> days = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
bool br, br1, br2;
char ch, ch1, ch2;
long long n, m, k, x, y, z, mini, maxi, l, r, sum, t, w;
pair<long long, long long> p, p1, p2;
set<long long> st, st1, st2;
multiset<long long> mst;
map<long long, long long> mp;
string s[(int)1e6 + 100];
long long a[((int)1e3 + 1)][(int)1e3 + 10];
long long b[((int)1e3 + 1)][(int)1e3 + 10];
vector<pair<long long, long long> > pos = {{0, 0}, {1, 0}, {2, 0}, {0, 1},
                                           {0, 2}, {1, 2}, {2, 2}, {2, 1}};
void solve() {
  cin >> n >> m;
  for (long long i = 0; i < n; i++) {
    cin >> s[i];
    for (long long j = 0; j < m; j++)
      if (s[i][j] == '#') a[i][j] = 1;
  }
  for (long long i = 0; i < n - 2; i++) {
    for (long long j = 0; j < m - 2; j++) {
      br = 0;
      for (auto k : pos) {
        if (a[i + k.first][j + k.second] == 0) br = 1;
      }
      if (br == 0) {
        for (auto k : pos) b[i + k.first][j + k.second] = 1;
      }
    }
  }
  br = 0;
  for (long long i = 0; i < n; i++)
    for (long long j = 0; j < m; j++)
      if (a[i][j] != b[i][j]) {
        br = 1;
        break;
      }
  if (br)
    cout << "NO\n";
  else
    cout << "YES\n";
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  solve();
  return 0;
}
