H,W = map(int,input().split()) S = [input().strip() for i in range(H)] black = [] for i in range(H): for j in range(W): if (S[i][j] == "#"): black.append((i,j)) else: pass if len(black) < 2: print("NO") exit() flag = "NO" #基準点 (x1, y1) = black[0] for (x , y) in black: (dx, dy) = (x - x1, y - y1) # 使ったマスの確認用 used = [[False]*W for t in range(H)] check = True for (i,j) in black: if (used[i][j] == True): continue else: used[i][j] = True (xi, yj) = (i + dx, j + dy) # 移動先が使えるか確認 if ((0 <= xi < H) and (0 <= yj < W )): if (not (used[xi][yj] == True)): if (S[xi][yj] == "#"): used[xi][yj] = True else: check = False break else: check = False break else: check = False break if (check == True): flag = "YES" break print(flag)