def main1(h,w,s):
  ary=[]
  for i in range(h):
    for j in range(w):
      if s[i][j]=="#":
        ary.append((i,j))
  if len(ary)%2==1:return False
  # 平行移動のパターンはH*W-1
  # すべて試す
  for i in range(h):
    for j in range(w):
      if i==0 and j==0:continue
      ary_st=set(ary)
      flg=True
      for x,y in ary:
        if (x,y) not in ary_st:continue
        ary_st.discard((x,y))
        if (x+i,y+j) in ary_st:
          ary_st.discard((x+i,y+j))
        else:
          #print((i,j),(x,y),ary_st)
          flg=False
          break
      if flg:
        return True
  return False
if __name__=='__main__':
  h,w=map(int,input().split())
  s=[input() for _ in range(h)]
  ret1=main1(h,w,s)
  if ret1:
    print("YES")
  else:
    print("NO")