package main

import (
	"bufio"
	"fmt"
	"io"
	"os"
	"strconv"
)

var (
	readString func() string
	readBytes  func() []byte
	stdout     *bufio.Writer
)

func init() {
	readString, readBytes = newReadString(os.Stdin)
	stdout = bufio.NewWriter(os.Stdout)
}

func newReadString(ior io.Reader) (func() string, func() []byte) {
	r := bufio.NewScanner(ior)
	r.Buffer(make([]byte, 1024), int(1e+11))
	r.Split(bufio.ScanWords)

	f1 := func() string {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Text()
	}
	f2 := func() []byte {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Bytes()
	}
	return f1, f2
}

func readInt() int {
	return int(readInt64())
}

func readInt64() int64 {
	i, err := strconv.ParseInt(readString(), 10, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

func readFloat64() float64 {
	f, err := strconv.ParseFloat(readString(), 64)
	if err != nil {
		panic(err.Error())
	}
	return f
}

func printf(f string, args ...interface{}) (int, error) {
	return fmt.Fprintf(stdout, f, args...)
}

func println(args ...interface{}) (int, error) {
	return fmt.Fprintln(stdout, args...)
}

func eprintln(args ...interface{}) (int, error) {
	return fmt.Fprintln(os.Stderr, args...)
}

func eprintf(f string, args ...interface{}) (int, error) {
	return fmt.Fprintf(os.Stderr, f, args...)
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func min64(a, b int64) int64 {
	if a < b {
		return a
	}
	return b
}

func max(a, b int) int {
	if a < b {
		return b
	}
	return a
}

func max64(a, b int64) int64 {
	if a < b {
		return b
	}
	return a
}

func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}

func abs64(a int64) int64 {
	if a < 0 {
		return -a
	}
	return a
}

func gcd(a, b int) int {
	if b == 0 {
		return a
	}
	return gcd(b, a%b)
}

func gcd64(a, b int64) int64 {
	if b == 0 {
		return a
	}
	return gcd64(b, a%b)
}

// readString() string
// readInt() int
// readInt64() int64
// readFloat64() float64

// -----------------------------------------------------------------------------

func main() {
	defer stdout.Flush()
	N := readInt()
	A := readInt() - 1
	B := readInt() - 1
	C := readInt() - 1
	D := readInt() - 1
	S := readBytes()

	if solve(N, A, B, C, D, S) {
		println("Yes")
	} else {
		println("No")
	}
}

func solve(N, A, B, C, D int, S []byte) bool {
	if (A < B && C < D) || (B < A && D < C) {
		return reachable(S, A, C) && reachable(S, B, D)
	}

	if A < B {
		return reachable(S, A, C) && reachable(S, B, D) && reachableSpecial(S, A, B, D)
	} else {
		return reachable(S, A, C) && reachable(S, B, D) && reachableSpecial(S, B, A, C)
	}
}

func reachable(S []byte, from, to int) bool {
	if S[to] == '#' {
		return false
	}

	var rs int
	for i := from; i <= to; i++ {
		if S[i] == '#' {
			rs++
			if 1 < rs {
				return false
			}
		} else {
			rs = 0
		}
	}
	return true
}

func reachableSpecial(S []byte, from, x, xto int) bool {
	if 0 < x && S[x-1] == '.' && S[x+1] == '.' {
		return true
	}
	if xto < len(S)-1 && S[xto-1] == '.' && S[xto+1] == '.' {
		return true
	}

	var ss int
	var foundx bool
	for i := from; i <= xto; i++ {
		if i == x {
			foundx = true
		}
		if foundx && S[i] == '.' {
			ss++
			if 3 <= ss {
				return true
			}
		} else {
			ss = 0
		}
	}
	return false
}

// -----------------------------------------------------------------------------


Measured memory_bytes: 1024