Problem:
Score: 300 points

Problem Statement

We have a canvas divided into a grid with H rows and W columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j).

Initially, all the squares are white. square1001 wants to draw a picture with black paint. His specific objective is to make Square (i, j) black when s_{i, j}= #, and to make Square (i, j) white when s_{i, j}= ..

However, since he is not a good painter, he can only choose two squares that are horizontally or vertically adjacent and paint those squares black, for some number of times (possibly zero). He may choose squares that are already painted black, in which case the color of those squares remain black.

Determine if square1001 can achieve his objective.

Constraints

H is an integer between 1 and 50 (inclusive).

W is an integer between 1 and 50 (inclusive).

For every (i, j) (1 \leq i \leq H, 1 \leq j \leq W), s_{i, j} is # or ..

Input

Input is given from Standard Input in the following format:

H W
s_{1, 1} s_{1, 2} s_{1, 3} ... s_{1, W}
s_{2, 1} s_{2, 2} s_{2, 3} ... s_{2, W}
: :
s_{H, 1} s_{H, 2} s_{H, 3} ... s_{H, W}

Output

If square1001 can achieve his objective, print Yes; if he cannot, print No.

Sample Input 1

3 3
.#.
###
.#.

Sample Output 1

Yes

One possible way to achieve the objective is shown in the figure below. Here, the squares being painted are marked by stars.

Sample Input 2

5 5
#.#.#
.#.#.
#.#.#
.#.#.
#.#.#

Sample Output 2

No

square1001 cannot achieve his objective here.

Sample Input 3

11 11
...#####...
.##.....##.
#..##.##..#
#..##.##..#
#.........#
#...###...#
.#########.
.#.#.#.#.#.
##.#.#.#.##
..##.#.##..
.##..#..##.

Sample Output 3

Yes

Solution in C++14 (GCC 5.4.1) (judge verdict: Accepted)

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
#define int ll
#define double ld
#define repd(i,a,b) for (int i=a;i<int(b);i++)
#define rep(i,n) repd(i,0,n)
#define VARNAME(v) #v
using P = pair<int,int>;
// constexpr  int MOD = 1000000007;
constexpr  int MOD = 998244353;
constexpr ll INF = 1e16;
#pragma region tmp
constexpr double EPS = 1e-10;
constexpr double PI = 3.141592653589793;
const string endn = "\n";
const string abc="abcdefghijklmnopqrstuvwxyz";
const string ABC="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
template<class T1, class T2>ostream &operator<<(ostream &out, const pair<T1, T2> &o){out << "(" << o.first << ", " << o.second << ")";return out;}
template<class T> ostream &operator<<(ostream &out, const vector<T> &o){for(auto itr=o.begin();itr != o.end();itr++)out << *itr << (itr+1 != o.end() ? " " : "");return out;}
template<class T> ostream &operator<<(ostream &out, const deque<T> &o){for(auto itr=o.begin();itr != o.end();itr++)out << *itr << (itr+1 != o.end() ? " " : "");return out;}
template<class T> ostream &operator<<(ostream &out, const set<T> &o){out << "{";for(auto itr=o.begin();itr != o.end();itr++)out << *itr << (next(itr,1) != o.end() ? "," : "");out << "}";return out;}
template<class T> ostream &operator<<(ostream &out, const multiset<T> &o){out << "{";for(auto itr=o.begin();itr != o.end();itr++)out << *itr << (next(itr,1) != o.end() ? "," : "");out << "}";return out;}
template<class T, class U> ostream &operator<<(ostream &out, const map<T, U> &o){out << "{";for(auto itr=o.begin();itr != o.end();itr++)out << *itr << (next(itr,1) != o.end() ? " " : "");out << "}";return out;}
template<class T, class U> ostream &operator<<(ostream &out, const multimap<T, U> &o){out << "{";for(auto itr=o.begin();itr != o.end();itr++)out << *itr << (next(itr,1) != o.end() ? " " : "");out << "}";return out;}
template<class T> ostream &operator<<(ostream &out, queue<T> o){while(!o.empty())out << o.front() << (o.size() > 0 ? " " : ""),o.pop();return out;}
template<class T, class U> ostream &operator<<(ostream &out, priority_queue<T, vector<T>, U> o){while(!o.empty())out << o.top() << (o.size() > 0 ? " " : ""),o.pop();return out;}
template<class T> ostream &operator<<(ostream &out, stack<T> o){while(!o.empty())out << o.top() << (o.size() > 0 ? " " : ""),o.pop();return out;}
template<class T> inline bool chmin(T& a, T b){if(a>=b){a = b;return 1;}return 0;}
template<class T> inline bool chmax(T& a, T b){if(a<=b){a = b;return 1;}return 0;}
template<class T> inline bool chmin(T& a, initializer_list<T> b){T c = min(b);if(a>c){a = c;return 1;}return 0;}
template<class T> inline bool chmax(T& a, initializer_list<T> b){T c = max(b);if(a<c){a = c;return 1;}return 0;}
inline int mrep(int& a, int M=MOD){a%=M;return a=(a<0 ? a+M : a);}
inline int add(int& a, int b, int M=MOD){return a=(mrep(a,M)+mrep(b,M))%M;}
inline int mul(int& a, int b, int M=MOD){return a=(mrep(a,M)*mrep(b,M))%M;}
inline int add(int& a, initializer_list<int> b, int M=MOD){return a=(mrep(a,M)+accumulate(b.begin(), b.end(), (int)0, [&M](int acc, int i){return (acc+mrep(i,M))%M;}))%M;}
inline int mul(int& a, initializer_list<int> b, int M=MOD){return a=(mrep(a,M)*accumulate(b.begin(), b.end(), (int)1, [&M](int acc, int i){return (acc*mrep(i,M))%M;}))%M;}
inline int modpow(int b, int e, int M=MOD){int ret=1;while(e > 0){if(e%2)mul(ret,b,M);mul(b,b,M);e /= 2;};return ret;}
inline int modinv(int a, int M=MOD){int b=M,u=1,v=0;while(b){int t=a/b;a-=t*b;swap(a,b);u-=t*v;swap(u,v);}return mrep(u,M);}
template<class T> inline void print(T a){cout << a << endl;}
template<class T> inline void print(vector<T> a, int n){chmin(n,int(a.size()));rep(i,n)cout << a[i] << (i != n-1 ? " " : "\n");}
template<class T, size_t SIZE> inline void print(T (&a)[SIZE], int n=SIZE){chmin(n,int(SIZE));rep(i,n)cout << a[i] << (i != n-1 ? " ":"\n");}
inline string yesno(bool b){return (b ? "Yes" : "No");}
#pragma #endregion tmp

signed main(){
  int h,w;cin>>h>>w;bool b = true;
  bool s[60][60];rep(i,60)rep(j,60)s[i][j] = true;
  repd(i,1,h+1){
    repd(j,1,w+1){
      char c;cin>>c;
      s[i][j] = (c == '#');
    }
  }
  repd(i,1,h+1){
    repd(j,1,w+1){
      b = b && (!s[i][j] || s[i-1][j] || s[i+1][j] || s[i][j-1] || s[i][j+1]);
    }
  }
  cout << yesno(b) << endl;
}