n,a,b,c,d=gets.chomp.split(" ").map(&:to_i)
arr=gets.chomp
a-=1
b-=1
c-=1
d-=1

ans = "YES"

if c < d
  if arr.slice((b+1)..(d-1)).include?("##")
    ans = “NO”
  end

  if  arr.slice((a+1)..(c-1)).include?("##")
    ans = “NO”
  end
else
  if not tmp.include?("...")
    ans = “NO”
  end
end
puts ans
