a, b = map(int, input().split(' ')) sq = [input().strip() for i in range(a)] sq2 = [c for k in sq for c in k] ans = 'NO' m_l = 0 m_r = 0 for c in sq: if '#' in c: m_l = max(c.index('#'), m_l) m_r = max(c[::-1].index('#'), m_r) if ('#' not in sq2) or sq2.count('#') % 2 == 1: print('NO') exit() for h in range(a): for w in range(-m_l, m_r+1): sq3 = list('0'*len(sq2)) for t in range(len(sq2)): if sq[t//b][t%b]=='#' and 0 < t%b+w < b and 0 < t//b+h < a: if sq[t//b+h][t%b+w] == '#' and sq3[t]=='0': sq3[t] = '1' sq3[t+w+(b*h)] = '1' if sq2.count('#') == sq3.count('1'): ans = 'YES' break print(ans)