H,W=gets.split.map(&:to_i) m=(1..H).map{gets.chomp}+[""]*50 ans=false H.times{|i|W.times{|j| next if i==0&&j==0 tm=m.map{|l|l.dup} H.times{|h|W.times{|w| if tm[h][w]==?# && tm[h+i][w+j]==?# tm[h][w]=tm[h+i][w+j]=?. end }} ans = true if !(tm*"")[?#] }} puts ans ?:YES:"NO"