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