#include <bits/stdc++.h>
using namespace std;
template <typename T>
void print(T a) {
  cout << a << " ";
}
template <typename T>
void println(T a) {
  cout << a << '\n';
}
char f(char c) {
  if (c == '#')
    return '.';
  else if (c == '.')
    return '#';
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long int n, m;
  cin >> n >> m;
  char arr[n][m];
  char copy[n][m];
  for (long long int i = 0; i < n; i++) {
    for (long long int j = 0; j < m; j++) {
      cin >> arr[i][j];
      copy[i][j] = '.';
    }
  }
  for (int i = 1; i < n - 1; i++) {
    for (int j = 1; j < m - 1; j++) {
      int a, b;
      int f = 0;
      a = j - 1;
      for (int x = i - 1; x <= i + 1; x++) {
        if (arr[x][a] == '#') {
          f++;
        }
      }
      a = j;
      if (arr[i - 1][a] == '#') {
        f++;
      }
      if (arr[i + 1][a] == '#') {
        f++;
      }
      a = j + 1;
      for (int x = i - 1; x <= i + 1; x++) {
        if (arr[x][a] == '#') {
          f++;
        }
      }
      if (f == 8) {
        a = j - 1;
        for (int x = i - 1; x <= i + 1; x++) {
          copy[x][a] = arr[x][a];
        }
        a = j;
        copy[i - 1][a] = arr[i - 1][a];
        copy[i + 1][a] = arr[i + 1][a];
        a = j + 1;
        for (int x = i - 1; x <= i + 1; x++) {
          copy[x][a] = arr[x][a];
        }
      }
    }
  }
  for (long long int i = 0; i < n; i++) {
    for (long long int j = 0; j < m; j++) {
      if (arr[i][j] != copy[i][j]) {
        cout << "NO";
        return 0;
      }
    }
  }
  cout << "YES" << '\n';
  return 0;
}
