H, W = map(int, input().split()) c = [] cnt = 0 for _ in range(H): s = list(input()) cnt += s.count('#') c.append(s) if cnt == 0 or cnt%2==1: print('NO') exit() def solve(i, j): r1, r2 = range(H), range(W) r11, r22 = reversed(range(H)), reversed(range(W)) w1 = [r1, r11] w2 = [r2, r22] p, q = w1[i<0], w2[j<0] b = set() for x in p: for y in q: if x+i<0 or x+i>H-1 or y+j<0 or y+j>W-1: if (x, y) not in b and c[x][y]=='#': return False else: continue if (x, y) in b or c[x][y] == '.': continue b.add((x, y)) if c[x+i][y+j]=='.': return False else: b.add((x+i, y+j)) return True for i in range(-H+1, H): for j in range(-W+1, W): if i == j: continue if solve(i, j): print('YES') exit() print('NO')