#include <bits/stdc++.h>
using namespace std;
char mp[1005][1005];
bool visi[1005][1005];
int main() {
  int n, m;
  while (cin >> n >> m) {
    memset(visi, 0, sizeof(visi));
    int full = 0;
    for (int i = 0; i < n; i++)
      for (int j = 0; j < m; j++) {
        cin >> mp[i][j];
        if (mp[i][j] == '#') full++;
      }
    for (int i = 1; i < n - 1; i++)
      for (int j = 1; j < m - 1; j++) {
        int f = 0;
        for (int u = -1; u <= 1; u++)
          for (int uu = -1; uu <= 1; uu++)
            if (mp[i - u][j - uu] == '#') {
              if (u == 0 && uu == 0) continue;
              f++;
            }
        if (f == 8)
          for (int u = -1; u <= 1; u++)
            for (int uu = -1; uu <= 1; uu++)
              if (!visi[i - u][j - uu]) {
                if (u == 0 && uu == 0) continue;
                visi[i - u][j - uu] = 1;
                full--;
              }
      }
    if (!full)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
