#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m;
  cin >> n >> m;
  vector<vector<char>> a(n, vector<char>(m)), ans(n, vector<char>(m, '.'));
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) cin >> a[i][j];
  for (int i = 1; i < n - 1; i++) {
    for (int j = 1; j < m - 1; j++) {
      if (a[i - 1][j - 1] == '#' && a[i - 1][j] == '#' &&
          a[i - 1][j + 1] == '#' && a[i][j - 1] == '#' && a[i][j + 1] == '#' &&
          a[i + 1][j - 1] == '#' && a[i + 1][j] == '#' &&
          a[i + 1][j + 1] == '#')
        ans[i - 1][j - 1] = '#', ans[i - 1][j] = '#', ans[i - 1][j + 1] = '#',
                       ans[i][j - 1] = '#', ans[i][j + 1] = '#',
                       ans[i + 1][j - 1] = '#', ans[i + 1][j] = '#',
                       ans[i + 1][j + 1] = '#';
    }
  }
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      if (a[i][j] != ans[i][j]) {
        cout << "NO";
        return 0;
      }
  cout << "YES";
  return 0;
}
