#include <bits/stdc++.h>
using namespace std;
void Fastio() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
void solve() {
  int n, m;
  cin >> n >> m;
  char c[n + 1][m + 1], d[n + 1][m + 1];
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      cin >> c[i][j];
      d[i][j] = '.';
    }
  }
  for (int i = 1; i < n - 1; ++i) {
    for (int j = 1; j < m - 1; ++j) {
      if (c[i - 1][j] == '#' && c[i + 1][j] == '#' && c[i][j - 1] == '#' &&
          c[i][j + 1] == '#' && c[i - 1][j + 1] == '#' &&
          c[i - 1][j - 1] == '#' && c[i + 1][j + 1] == '#' &&
          c[i + 1][j - 1] == '#') {
        d[i - 1][j] = d[i + 1][j] = d[i][j + 1] = d[i][j - 1] =
            d[i - 1][j - 1] = d[i - 1][j + 1] = d[i + 1][j - 1] =
                d[i + 1][j + 1] = '#';
      }
    }
  }
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      if (c[i][j] != d[i][j]) {
        cout << "NO" << endl;
        return;
      }
    }
  }
  cout << "YES" << endl;
}
int main() {
  Fastio();
  solve();
  return 0;
}
