def is_valid(y,x,board): h = len(board) w = len(board[0]) if not (0 <= y < h): return False if not (0 <= x < w): return False if board[y][x] == ".": return False return True def check(board,dy,dx,black_count): h = len(board) w = len(board[0]) used = set() for y in range(h): for x in range(w): if board[y][x] == ".": continue if (y,x) in used: continue if not is_valid(y+dy,x+dx,board): return False black_count -= 2 used.add((y+dy,x+dx)) if black_count > 0: return False return True def main(): h,w = map(int,input().split()) board = [] black_count = 0 for _ in range(h): line:list = list(input()) board.append(line) black_count += line.count("#") if black_count == 0: print("NO") return for dy in range(h): for dx in range(-w,w): if dy == 0 and dx == 0: continue if check(board,dy,dx,black_count): print("YES") return print("NO") return main()