#include <bits/stdc++.h>
using namespace std;
const long long N = 1e3 + 10;
char grid[N][N], my_grid[N][N];
bool check(long long r1, long long c1);
void color(long long r1, long long c1);
bool match(long long r, long long c);
int main() {
  ios_base ::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long r, c;
  cin >> r >> c;
  for (long long i = 1; i <= r; ++i) {
    for (long long j = 1; j <= c; ++j) {
      cin >> grid[i][j];
      my_grid[i][j] = '.';
    }
  }
  for (long long i = 1; i <= r; ++i) {
    for (long long j = 1; j <= c; ++j) {
      if (check(i, j)) {
        color(i, j);
      }
    }
  }
  if (match(r, c)) {
    cout << "YES\n";
  } else {
    cout << "NO\n";
  }
  return 0;
}
bool check(long long r1, long long c1) {
  for (long long i = r1 - 1; i <= r1 + 1; ++i) {
    for (long long j = c1 - 1; j <= c1 + 1; ++j) {
      if (!(i == r1 && j == c1)) {
        if (grid[i][j] != '#') {
          return false;
        }
      }
    }
  }
  return true;
}
void color(long long r1, long long c1) {
  for (long long i = r1 - 1; i <= r1 + 1; ++i) {
    for (long long j = c1 - 1; j <= c1 + 1; ++j) {
      if (!(i == r1 && j == c1)) {
        my_grid[i][j] = '#';
      }
    }
  }
}
bool match(long long r, long long c) {
  for (long long i = 1; i <= r; ++i) {
    for (long long j = 1; j <= c; ++j) {
      if (grid[i][j] != my_grid[i][j]) {
        return false;
      }
    }
  }
  return true;
}
