#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
using ull = unsigned long long int;
using ld = long double;
constexpr ll MOD = 1e9 + 7;
constexpr ll INF = 1e18;
inline bool print(vector<string> &grid, int x, int y) {
  for (int i = -1; i <= 1; ++i) {
    for (int j = -1; j <= 1; ++j) {
      if (i == 0 && j == 0) continue;
      if (grid[x + i][y + j] == '.') {
        return false;
      }
    }
  }
  return true;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  ;
  int n, m;
  cin >> n >> m;
  vector<string> grid(n);
  for (int i = 0; i < n; ++i) {
    cin >> grid[i];
  }
  vector<string> res(n, string(m, '.'));
  for (int i = 1; i < n - 1; ++i) {
    for (int j = 1; j < m - 1; ++j) {
      if (print(grid, i, j)) {
        for (int k = -1; k <= 1; ++k) {
          for (int l = -1; l <= 1; ++l) {
            if (k == 0 && l == 0) continue;
            res[i + k][j + l] = '#';
          }
        }
      }
    }
  }
  for (int i = 0; i < n; ++i) {
    if (grid[i] != res[i]) {
      cout << "NO\n";
      return 0;
    }
  }
  cout << "YES\n";
}
