#include <bits/stdc++.h>
using namespace std;
long long b[100001];
bool used[2001];
vector<int> g[1001];
char a[1001][1001];
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  ;
  long long n, m, cnt = 0, k, ans = 0;
  bool second = 0;
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      cin >> a[i][j];
    }
  }
  for (int i = 2; i < n; i++) {
    for (int j = 2; j < m; j++) {
      if (a[i][j + 1] != '.' && a[i][j - 1] != '.' && a[i + 1][j] != '.' &&
          a[i - 1][j] != '.' && a[i - 1][j - 1] != '.' &&
          a[i + 1][j - 1] != '.' && a[i + 1][j + 1] != '.' &&
          a[i - 1][j + 1] != '.') {
        a[i][j + 1] = '2';
        a[i][j - 1] = '2';
        a[i + 1][j] = '2';
        a[i - 1][j] = '2';
        a[i - 1][j - 1] = '2';
        a[i + 1][j - 1] = '2';
        a[i + 1][j + 1] = '2';
        a[i - 1][j + 1] = '2';
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      if (a[i][j] == '#') {
        cout << "NO";
        return 0;
      }
    }
  }
  cout << "YES";
  return 0;
}
