function Main(input) {
	lines = input.split("\n")
	N = parseInt(lines[0].split(' ')[0], 10)
	A = parseInt(lines[0].split(' ')[1], 10)
	B = parseInt(lines[0].split(' ')[2], 10)
	C = parseInt(lines[0].split(' ')[3], 10)
	D = parseInt(lines[0].split(' ')[4], 10)
	S = lines[1].split('')
	flag = false
	while(A !== C || B !== D) {
	  if(S[A]!=='#' && A+1!==B && A+1<=C) {A++}
	  else if(S[A+1]!=='#' && A+2 !== B && A+2 <= C) {A+=2}
	  else if(S[B]!=='#' && B+1 <= D){B++}
	  else if(S[B+1]!=='#' && B+2<=D){B+=2}
	  else {flag=true;break}
	}
	flag ? console.log('No') : console.log('YES');
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"))
