def func(d, r, sharps): find = set() for y, x in sharps: if (y, x) in find: continue ny = y + d nx = x + r if (ny, nx) in sharps: find.add((y, x)) find.add((ny, nx)) else: return False return len(find) == len(sharps) def main(): h, w = map(int, input().split()) sharps = [] for y in range(h): line = input() for x in range(len(line)): if line[x] == '#': sharps.append((y, x)) for d in range(50): for r in range(-50, 50): if d == 0 and r == 0: continue if func(d, r, sharps): print("YES") return print("NO") if __name__ == '__main__': main()