#include <bits/stdc++.h>
int B = 400;
using namespace std;
const long long inf = 1e17;
int mod = 998244353;
const int mxn = 200010;
int N, M;
int dx[] = {0, 1, 0, -1, 1, -1, 1, -1};
int dy[] = {1, 0, -1, 0, -1, 1, 1, -1};
bool ink[1040][1040], not_ink[1040][1040];
char ch[1040][1040];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> N >> M;
  for (int i = 1; i <= N; i++)
    for (int j = 1; j <= M; j++) {
      cin >> ch[i][j];
      if (ch[i][j] == '.') not_ink[i][j] = 1;
    }
  for (int i = 2; i < N; i++)
    for (int j = 2; j < M; j++) {
      bool inked = 1;
      for (int k = 0; k < 8 && inked; k++)
        inked = !not_ink[i + dx[k]][j + dy[k]];
      if (inked)
        for (int k = 0; k < 8; k++) ink[i + dx[k]][j + dy[k]] = 1;
    }
  for (int i = 1; i <= N; i++)
    for (int j = 1; j <= M; j++) {
      if (!ink[i][j] && !not_ink[i][j]) {
        cout << "NO" << endl;
        return 0;
      }
    }
  cout << "YES" << endl;
}
