fun main(args: Array<String>) {
    val (n, a, b, c, d) = readLine()!!.split(" ").map(String::toInt)
    val map = readLine()!!.toCharArray()

    if (c < d) {
        val funukeIsReachable = isReachable(map, b - 1, d - 1)
        if (!funukeIsReachable) {
            println("No")
            return
        }

        map[d - 1] = '#'
        val sunukeIsReachable = isReachable(map, a - 1, c - 1)
        if (!sunukeIsReachable) {
            println("No")
            return
        }

        println("Yes")
    } else {
        val g = moveToGoodPlace(map, b - 1, d - 1)
        if (g == -1) {
            println("No")
            return
        }

        map[g] = '#'

        val sunukeIsReachable = isReachable(map, a - 1, c - 1)
        if (!sunukeIsReachable) {
            println("No")
            return
        }

        if (g == d - 1) {
            println("Yes")
            return
        }

        val funukeIsReachable = isReachable(map, g, d - 1)
        if (!funukeIsReachable) {
            println("No")
            return
        }

        println("Yes")
    }
}

fun isReachable(map: CharArray, from: Int, to: Int): Boolean {
    var current = from
    while (current < to) {
        if (map[current + 1] != '#') {
            current++
            continue
        }
        if (map[current + 2] != '#') {
            current += 2
            continue
        }
        break
    }
    return current == to
}

fun moveToGoodPlace(map: CharArray, from: Int, to: Int): Int {
    var current = from
    while (current < to) {
        if (map[current - 1] == '.' && map[current + 1] == '.') {
            return current
        }
        if (map[current + 1] != '#') {
            current++
            continue
        }
        if (map[current + 2] != '#') {
            current += 2
            continue
        }
        return -1
    }
    return current
}
