#include <bits/stdc++.h>
using namespace std;
const int dx[8] = {-1, 0, 1, -1, 1, -1, 0, 1},
          dy[8] = {-1, -1, -1, 0, 0, 1, 1, 1};
char a[1010][1010], b[1010][1010];
int n, m;
int main() {
  scanf("%d %d\n", &n, &m);
  for (int i = 0; i < n; i++) scanf("%s\n", a[i]);
  for (int i = 1; i < n - 1; i++)
    for (int j = 1; j < m - 1; j++) {
      bool flag = true;
      for (int k = 0; k < 8; k++)
        if (a[i + dy[k]][j + dx[k]] == '.') {
          flag = false;
          break;
        }
      if (!flag) continue;
      for (int k = 0; k < 8; k++) b[i + dy[k]][j + dx[k]] = '#';
    }
  bool flag = true;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      if (a[i][j] != (b[i][j] ? '#' : '.')) flag = false;
  puts(flag ? "YES" : "NO");
}
