h, w = map(int, input().split()) S = [input() for _ in range(h)] points = [] dic = {} for i in range(h): for j in range(w): if S[i][j] == "#": dic[(i, j)] = len(points) points.append((i, j)) l = len(points) if l % 2 == 1: print("NO") exit() for i in range(l): for j in range(i + 1, l): di = points[j][0] - points[i][0] dj = points[j][1] - points[i][1] used = [False] * l for k in range(l): if used[k]: continue ni = points[k][0] + di nj = points[k][1] + dj if (ni, nj) not in dic: break x = dic[(ni, nj)] used[x] = True else: print("YES") exit() print("NO")