import sys import itertools import copy def _pred(move_x, move_y, H, W, s): if move_x == 0 and move_y == 0: return False for x, y in itertools.product(range(H), range(W)): if s[x][y] == 'b': s[x][y] = 'R' x2 = x + move_x y2 = y + move_y if 0 <= x2 < H and 0 <= y2 < W and s[x2][y2] == 'b': s[x2][y2] = 'B' else: return False return True def resolve(in_): H, W = map(int, next(in_).split()) black = ord(b'#') white = ord(b' ') S = [] for s in itertools.islice(in_, H): S.append(['b' if i == black else 'w' for i in s.rstrip()]) if all('b' not in s for s in S): return 'NO' ans = any(_pred(move_x, move_y, H, W, copy.deepcopy(S)) for move_x, move_y in itertools.product(range(-H + 1, H), range(-W + 1, W))) return 'YES' if ans else 'NO' def main(): ans = resolve(sys.stdin.buffer) print(ans) if __name__ == '__main__': main()