fun main(args : Array<String>) {
    val (N, A, B, C, D) = readLine()!!.split(" ").map { it.toInt() }
    val S = readLine()!!

    var a = A - 1
    var b = B - 1
    val shouldAPassOver = D < C

    while (true) {
        if (a == (C -1) && b == (D - 1)) {
            println("Yes")
            return
        }
        val canAMove1 = if (a + 1 >= N) false else S[a + 1] == '.'
        val canAMove2 = if (a + 2 >= N) false else S[a + 2] == '.'
        val canBMove1 = if (b + 1 >= N) false else S[b + 1] == '.'
        val canBMove2 = if (b + 2 >= N) false else S[b + 2] == '.'

        // Anyone can't move
        if (!(canAMove1 || canAMove2 || canBMove1 || canBMove2)) {
            println("No")
            return
        }

        if (shouldAPassOver) {
            if (canAMove1 && a + 1 != b) {
                a += 1
            } else if (canAMove2 && a + 2 !=b ) {
                a += 2
            } else if (canBMove1) {
                b += 1
            } else {
                b += 2
            }
        } else {
            // Move B first
            if (canBMove1) {
                b += 1
            } else if (canBMove2) {
                b += 2
            } else if (canAMove1) {
                a += 1
            } else if (canAMove2) {
                a += 2
            }
        }
    }
}