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-1)).include?("##") and not arr.slice((a+1)..(c-1)).include?("##")
    puts("YES")
  else
    puts("NO")
  end
else
  tmp=arr.slice((a+1)..(c-1))
  arr[c]="#"
  if not tmp.include?("##") and tmp.include?("...") and not arr.include?("###")
    puts("YES")
  else
    puts("NO")
  end
end
