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

if c < d
  if not arr.slice((b+1)..d).include?("##") and not arr.slice((a+1)..c).include?("##")
    puts "YES"
  else
    puts "NO"
  end
else
  tmp=arr.slice((a+1)..c)
  arr[c]="#"
  if tmp.include?("...")
    puts "YES"
  else
    puts "NO"
  end
end
