#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000 + 10;
char mp[maxn][maxn];
char empty[maxn][maxn];
bool can[maxn][maxn];
void solve(int x, int y) {
  can[x][y - 1] = can[x - 1][y - 1] = can[x - 1][y] = can[x - 1][y] =
      can[x - 1][y + 1] = can[x][y + 1] = can[x + 1][y + 1] = can[x + 1][y] =
          can[x + 1][y - 1] = 0;
}
void forge(int x, int y) {
  empty[x][y - 1] = empty[x - 1][y - 1] = empty[x - 1][y] = empty[x - 1][y] =
      empty[x - 1][y + 1] = empty[x][y + 1] = empty[x + 1][y + 1] =
          empty[x + 1][y] = empty[x + 1][y - 1] = '#';
}
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i <= n; i++)
    for (int j = 0; j <= m; j++) {
      can[i][j] = 1;
      empty[i][j] = '.';
    }
  for (int i = 1; i <= n; i++) scanf("%s", mp[i] + 1);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) {
      if (i == 1 || i == n || j == 1 || j == m) {
        can[i][j] = 0;
      }
      if (mp[i][j] == '.') solve(i, j);
    }
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) {
      if (can[i][j]) {
        forge(i, j);
      }
    }
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) {
      if (mp[i][j] != empty[i][j]) {
        cout << "NO\n";
        return 0;
      }
    }
  cout << "YES\n" << endl;
  return 0;
}
