gets s=`dd` r=0..3e3 puts r.any?{|d|t=s*1;r.all?{|i|t[i]==?#?t[i-=~d]==?#&&t[i]=?.:s[?#]}}?:YES: :NO