n,a,b,c,d=gets.chomp.split(" ").map(&:to_i)
arr=gets.chomp.split(" ")
a-=1
b-=1
c-=1
d-=1
if c < d
  if arr.slice(b...d).join.include?("##")
    puts "YES"
  else
    puts "NO"
  end
else
  tmp=arr.slice(a...c).join
  if not tmp.include?("##") and tmp.include?("...")
    puts "YES"
  else
    puts "NO"
  end
end
    