class Array
  def swap!(a, b)
    self[a], self[b] = self[b], self[a]
  end
end

n,a,b,c,d=gets.split.map(&:to_i);
s=gets.chomp.chars;
s[a-1]="A"
s[b-1]="B"
#puts s.join

n.times{
s2=s.each_index.select{|i| s[i] == "."}
b1=s.index("B")+1
if s2.include?(b1)
    s.swap!(b1-1,b1)
    #puts s.join
end

s2=s.each_index.select{|i| s[i] == "."}
b2=s.index("B")+2
if s2.include?(b2)
    s.swap!(b2-2,b2)
    #puts s.join
end

s2=s.each_index.select{|i| s[i] == "."}
a1=s.index("A")+1
if s2.include?(a1)
    s.swap!(a1-1,a1)
    #puts s.join
end

s2=s.each_index.select{|i| s[i] == "."}
a2=s.index("A")+2
if s2.include?(a2)
    s.swap!(a2-2,a2)
    #puts s.join
end
}
puts s.index("A")==c-1&&s.index("B")==d-1 ? "Yes" : "No"
