#include <bits/stdc++.h>
using namespace std;
long long int countDivisor(vector<long long int> &v, long long int n) {
  for (long long int i = 1; i * i <= n; i++) {
    if (i * i == n) {
      v.push_back(i);
    } else if (n % i == 0) {
      v.push_back(i);
      v.push_back(n / i);
    }
  }
}
bool isprime(long long int n) {
  for (long long int i = 2; i <= sqrt(n); i++) {
    if (n % i == 0) {
      return false;
    }
  }
  return true;
}
void solve() {
  vector<long long int> v, v2;
  map<long long int, long long int> mp;
  long long int n, m, j, y, i, k, x, c = 0, d, l, r, ans2 = 0;
  cin >> n >> m;
  char ch[n + 1][m + 1];
  long long int a[n + 1][m + 1], b[n + 1][m + 1];
  for (i = 0; i < n; i++) {
    for (j = 0; j < m; j++) {
      cin >> ch[i][j];
      a[i][j] = 0;
      if (ch[i][j] == '#')
        b[i][j] = 1;
      else
        b[i][j] = 0;
    }
  }
  for (i = 1; i < n - 1; i++) {
    for (j = 1; j < m - 1; j++) {
      if (ch[i - 1][j] == '#' && ch[i + 1][j] == '#' && ch[i][j - 1] == '#' &&
          ch[i][j + 1] == '#' && ch[i - 1][j - 1] == '#' &&
          ch[i - 1][j + 1] == '#' && ch[i + 1][j + 1] == '#' &&
          ch[i + 1][j - 1] == '#') {
        a[i - 1][j] = 1;
        a[i + 1][j] = 1;
        a[i][j - 1] = 1;
        a[i][j + 1] = 1;
        a[i - 1][j - 1] = 1;
        a[i - 1][j + 1] = 1;
        a[i + 1][j + 1] = 1;
        a[i + 1][j - 1] = 1;
      }
    }
  }
  bool f = false;
  for (i = 0; i < n; i++) {
    for (j = 0; j < m; j++) {
      if (a[i][j] != b[i][j]) {
        f = true;
        break;
      }
    }
  }
  if (f)
    cout << "NO" << endl;
  else
    cout << "YES" << endl;
}
int main() {
  int T = 1;
  while (T--) solve();
  return 0;
}
