import java.util.*
fun main(args: Array<String>){
	val cin = Scanner(System.`in`)
    val n = cin.nextInt()
    val a = cin.nextInt() - 1
    val b = cin.nextInt() - 1
    val c = cin.nextInt() - 1
    val d = cin.nextInt() - 1
    val s = cin.next()

    var ok = true
    if (d > c) {
        for (i in a..d-1) {
            if (s[i] == '#' && s[i+1] == '#') {
                ok = false
                break
            }
        }
    } else {
        var exist_triple = false
        for (i in a..c-1) {
            if (s[i] == '#' && s[i+1] == '#') {
                ok = false
                break
            }  
            if (i >= b && d >= i) {
                if (s[i] == '.' && s[i+1] == '.' && s[i-1] == '.') {
                    exist_triple = true
                }
            }    
        }
        if (!exist_triple) {
            ok = false
        }
    }
    if (ok) {
        println("Yes")
    } else {
        println("No")
    }
}