N, A, B, C, D = gets.chomp.split(' ').map(&:to_i)
S = (gets.chomp)[0 .. N]

Walks = 0.upto(S.size-2).map do |i|
    next -2 if S[i..i+1] == "##"
    next -1 if S[i..i+1] == "#."
    next  1 if S[i..i+1] == ".#"
    next  3 if S[i..i+2] == "..."
    2
end

def can_goal(start, goal)
    m = Walks[start-1 .. goal-2]

    return !m.any? { |i| i == -2 }
end

def can_wait(start, goal)
    m = Walks[start .. goal]
    return false if m.any? { |i| i == -2 }
    return m.any? { |i| i == 3 }
end

pos  = C > D ? [ A, B ] : [ B, A ]
goal = C > D ? [ C, D ] : [ D, C ]

result = lambda do
    if pos[0] < pos[1]
        return false if not can_wait(pos[1], goal[1])
        return can_goal(pos[1], goal[0]) && can_goal(pos[1], goal[1])
    end
    if can_goal(pos[0], goal[0])
        return true if can_goal(pos[1], goal[1])
    end
    return false
end.call

puts result ? "Yes" : "No"
