#include <bits/stdc++.h>
using namespace std;
int n, m, a[1005][1005], res[1005][1005];
int dx[8] = {0, 0, 1, 1, 1, -1, -1, -1};
int dy[8] = {1, -1, 0, 1, -1, 0, 1, -1};
int main() {
  ios_base ::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      char t;
      cin >> t;
      if (t == '#') a[i][j] = 1;
    }
  }
  for (int i = 2; i <= n - 1; i++) {
    for (int j = 2; j <= m - 1; j++) {
      int check = 1;
      for (int k = 0; k <= 7; k++) {
        int ii = i + dx[k], jj = j + dy[k];
        if (a[ii][jj] == 0) check = 0;
      }
      if (check == 0) continue;
      for (int k = 0; k <= 7; k++) {
        int ii = i + dx[k], jj = j + dy[k];
        res[ii][jj] = 1;
      }
    }
  }
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) {
      if (res[i][j] != a[i][j]) {
        cout << "NO";
        return 0;
      }
    }
  cout << "YES";
}
