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