n,a,b,c,d = gets.split.map(&:to_i)
s = gets.chomp
ans = true
if c < d
    x = 0
    ((a-1)..(d-1)).each do |i|
        if s[i] == "#"
            x += 1
        else
            x = 0
        end
        if x > 1
            ans = false
            break
        end
    end
else
    x = 0
    ((a-1)..(c-1)).each do |i|
        if s[i] == "#"
            x += 1
        else
            x = 0
        end
        if x > 1
            ans = false
            break
        end
    end
    y = false
    y = true if s[b] == "." && s[b-2] == "."
    z = 0
    ((b-1)..d).each do |i|
        if s[i] == "#"
            z = 0
        else
            z += 1
        end
        if z > 2
            y = true
            break
        end
    end
    ans = false if !y
end
puts (ans ? "Yes" : "No")