#include // #include // #include "icld.cpp" using namespace std; using ll = long long int; using vi = vector; using si = set; using vll = vector; using vvi = vector>; using ss = string; using db = double; template using minpq = priority_queue ,greater>; const int dx[4] = {1,0,-1,0}; const int dy[4] = {0,1,0,-1}; #define V vector #define P pair #define PLL pair #define rep(i,s,n) for(int i=(s);i<(int)(n);i++) #define rev(i,s,n) for(int i=(s);i>=(int)(n);i--) #define reciv(v,n) vll (v)((n)); rep(i,0,(n))cin>>v[i] #define all(v) v.begin(),v.end() #define rall(v) v.rbegin(),v.rend() #define ci(x) cin >> x #define cii(x) ll x;cin >> x #define cci(x,y) ll x,y;cin >> x >> y #define co(x) cout << x << endl #define pb push_back #define eb emplace_back #define rz resize #define pu push #define sz(x) int(x.size()) #define vij v[i][j] // ll p = 1e9+7; // ll p = 998244353; // n do -> n*pi/180 #define yn cout<<"Yes"<void chmax(T &x,T y){x=max(x,y);} templatevoid chmin(T &x,T y){x=min(x,y);} int main(){ cci(h,w); V

v; map mp; int cnt=0; rep(i,0,h){ rep(j,0,w){ char c;ci(c); if(c=='#')v.pb(P(i,j)),mp[P(i,j)]=cnt++; } } int n=sz(v); if(n==0 or n%2==1)return co("NO"),0; rep(i,1,n){ int x=v[i].first-v[0].first; int y=v[i].second-v[0].second; vi bl(n,0); bl[0]=bl[i]=1; int f=1; rep(j,0,n){ if(bl[j])continue; P np=P(v[j].first+x,v[j].second+y); if(!mp.count(np)){ f=0; break; } bl[j]=bl[mp[np]]=1; } if(f)return co("YES"),0; } co("NO"); }