m,n=gets.split.map &:to_i a=(1..m).map{gets}<<"" c=0 m.times{|p|n.times{|q|next if a[p][q]!=?. x=p y=q u=1 v=0 f=0 400.times{if a[z=x+v][w=y-u]==?. a[x=z][y=w]=?# u,v=v,-u f+=1 elsif a[z=x+u][w=y+v]==?. a[x=z][y=w]=?# elsif a[z=x-v][w=y+u]==?. a[x=z][y=w]=?# u,v=-v,u end} c+=x==p&&y==q&&f<2?1:2}} puts c==1?:YES: :NO