from collections import defaultdict H, W = map(int, input().split()) S = [input() for _ in range(H)] def check(dr, dc, s: set) -> bool: d = defaultdict(int) for r in range(H): for c in range(W): if (r, c) not in s: continue # 移動元がある if (r, c) in d: continue nr = r + dr nc = c + dc if (nr, nc) in s: # 移動先に # がある d[nr, nc] = True else: return False return True def solve(): s = set() for i in range(H): for j in range(W): if S[i][j] == '#': s.add((i, j)) if len(s) % 2 == 1: return False for i in range(H): for j in range(W): if i == 0 and j == 0: continue ok = check(i, j, s) if ok: return True return False if solve(): print('YES') else: print('NO')