#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long i, j, n, t = 1, k = 0, cnt = 0, mini = LLONG_MAX, maxi = LLONG_MIN,
                     ans = 0;
  long long m;
  cin >> n >> m;
  string s[n];
  for (i = 0; i < n; i++) cin >> s[i];
  long long a[n][m], b[n][m];
  for (i = 0; i < n; i++)
    for (j = 0; j < m; j++) b[i][j] = 0;
  for (i = 0; i < n; i++)
    for (j = 0; j < m; j++) a[i][j] = (s[i][j] == '#' ? 1 : 0);
  for (i = 1; i < n - 1; i++) {
    for (j = 1; j < m - 1; j++) {
      if (a[i - 1][j] == 1 && a[i - 1][j - 1] == 1 && a[i - 1][j + 1] == 1 &&
          a[i][j - 1] == 1 && a[i][j + 1] == 1 && a[i + 1][j] == 1 &&
          a[i + 1][j - 1] == 1 && a[i + 1][j + 1] == 1) {
        b[i - 1][j] = 1;
        b[i - 1][j - 1] = 1;
        b[i - 1][j + 1] = 1;
        b[i][j - 1] = 1;
        b[i][j + 1] = 1;
        b[i + 1][j] = 1;
        b[i + 1][j - 1] = 1;
        b[i + 1][j + 1] = 1;
      }
    }
  }
  for (i = 0; i < n; i++) {
    for (j = 0; j < m; j++) {
      if (a[i][j] != b[i][j]) return cout << "NO", 0;
    }
  }
  return cout << "YES", 0;
  return 0;
}
