#include <bits/stdc++.h>
using namespace std;
const int N = 1010;
int n, m;
bool a[N][N], b[N][N];
char str[N];
int cx[] = {-1, -1, -1, 0, 0, 1, 1, 1};
int cy[] = {-1, 0, 1, -1, 1, -1, 0, 1};
void paint(int x, int y) {
  int dx, dy;
  for (int i = 0; i < 8; i++) {
    dx = x + cx[i], dy = y + cy[i];
    if (a[dx][dy]) return;
  }
  for (int i = 0; i < 8; i++) {
    dx = x + cx[i], dy = y + cy[i];
    b[dx][dy] = 1;
  }
  return;
}
bool check() {
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++)
      if (!b[i][j]) return false;
  return true;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%s", str + 1);
    for (int j = 1; j <= m; j++)
      if (str[j] == '.') a[i][j] = b[i][j] = 1;
  }
  for (int i = 2; i < n; i++)
    for (int j = 2; j < m; j++) paint(i, j);
  if (check())
    printf("YES\n");
  else
    printf("NO\n");
  return 0;
}
