#!/usr/bin/env PyPy3 from collections import Counter, defaultdict, deque import itertools import re import math from functools import reduce import operator import bisect from heapq import * import functools mod=10 ** 9 + 7 import sys input = sys.stdin.readline h,w=map(int,input().split()) s = [input().rstrip() for _ in range(h)] li = [] for i in range(h): for j in range(w): if s[i][j] == '#': li.append((i,j)) if len(li) % 2: print('NO') else: for i in range(1,len(li)): px = li[i][0] - li[0][0] py = li[i][1] - li[0][1] ns = [[0] * w for _ in range(h)] flg = 0 for j in range(h): for k in range(w): if s[j][k] == '#': if ns[j][k]: continue ns[j][k] = 1 if 0 <= j + px < h and 0 <= k + py < w: if s[j + px][k + py] == '#' and ns[j + px][k + py] == 0: ns[j + px][k + py] = 1 else: flg = 1 break else: flg = 1 break if flg: break if not flg: print('YES') exit() print('NO')