#!/usr/bin/env python3

# from numba import njit

# input = stdin.readline

# @njit
def solve(a,b,c,d,s):
  if '##' in s[a:c+1] or '##' in s[b:d+1]:
    return False
  if c < d:
    return True
  elif c > d:
    if "..." in s[b-1:d+2]:
      return True
    else:
      return False
  else:
    raise ValueError




def main():
  N,A,B,C,D = map(int,input().split())
  A -= 1
  B -= 1
  C -= 1
  D -= 1
  S = input()
  print("Yes" if solve(A,B,C,D,S) else "No")
  return

if __name__ == '__main__':
  main() def solve(a,b,c,d,s):
  if '##' in s[a:c+1] or '##' in s[b:d+1]:
    return False
  if c < d:
    return True
  elif c > d:
    if "..." in s[b-1:d+2]:
      return True
    else:
      return False
  else:
    raise ValueError solve if '##' in s[a:c+1] or '##' in s[b:d+1]:
    return False
   '##' in s[a:c+1] or '##' in s[b:d+1] '##' in s[a:c+1] '##' s[a:c+1] s a:c+1 a c+1 c 1 '##' in s[b:d+1] '##' s[b:d+1] s b:d+1 b d+1 d 1 return False False if c < d:
    return True
  elif c > d:
    if "..." in s[b-1:d+2]:
      return True
    else:
      return False
  else:
    raise ValueError c < d c d return True True elif c > d:
    if "..." in s[b-1:d+2]:
      return True
    else:
      return False
   c > d c d if "..." in s[b-1:d+2]:
      return True
    else:
      return False
   "..." in s[b-1:d+2] "..." s[b-1:d+2] s b-1:d+2 b-1 b 1 d+2 d 2 return True True return False False raise ValueError ValueError a a b b c c d d s s def main():
  N,A,B,C,D = map(int,input().split())
  A -= 1
  B -= 1
  C -= 1
  D -= 1
  S = input()
  print("Yes" if solve(A,B,C,D,S) else "No")
  return main N,A,B,C,D = map(int,input().split()) N map(int,input().split()) map int input().split() ().split () input split A B C D A -= 1 A 1 B -= 1 B 1 C -= 1 C 1 D -= 1 D 1 S = input() S input() input print("Yes" if solve(A,B,C,D,S) else "No") print "Yes" if solve(A,B,C,D,S) else "No" solve(A,B,C,D,S) solve A B C D S "Yes" "No" return if __name__ == '__main__':
  main() __name__ == '__main__' __name__ '__main__' main() main def solve(a,b,c,d,s):
  if '##' in s[a:c+1] or '##' in s[b:d+1]:
    return False
  if c < d:
    return True
  elif c > d:
    if "..." in s[b-1:d+2]:
      return True
    else:
      return False
  else:
    raise ValueError def solve(a,b,c,d,s):
  if '##' in s[a:c+1] or '##' in s[b:d+1]:
    return False
  if c < d:
    return True
  elif c > d:
    if "..." in s[b-1:d+2]:
      return True
    else:
      return False
  else:
    raise ValueError solve def main():
  N,A,B,C,D = map(int,input().split())
  A -= 1
  B -= 1
  C -= 1
  D -= 1
  S = input()
  print("Yes" if solve(A,B,C,D,S) else "No")
  return def main():
  N,A,B,C,D = map(int,input().split())
  A -= 1
  B -= 1
  C -= 1
  D -= 1
  S = input()
  print("Yes" if solve(A,B,C,D,S) else "No")
  return main
#!/usr/bin/env python3

# from numba import njit

# input = stdin.readline

# @njit
def solve(a,b,c,d,s):
  if '##' in s[a:c+1] or '##' in s[b:d+1]:
    return False
  if c < d:
    return True
  elif c > d:
    if "..." in s[b-1:d+2]:
      return True
    else:
      return False
  else:
    raise ValueError




def main():
  N,A,B,C,D = map(int,input().split())
  A -= 1
  B -= 1
  C -= 1
  D -= 1
  S = input()
  print("Yes" if solve(A,B,C,D,S) else "No")
  return

if __name__ == '__main__':
  main()
