def resolve():
  n, a, b, c, d = map(int, input().split())
  a -= 1
  b -= 1
  c -= 1
  d -= 1
  s = input()

  # a と c の間に ## があったらだめ
  for i in range(a, c):
    if s[i] == '#' and s[i+1] == '#':
      print('No')
      return
  # b と d の間に ## があったらだめ
  for i in range(b, d):
    if s[i] == '#' and s[i+1] == '#':
      print('No')
      return
  # a が b を飛び越えないと行けない場合  b - d の間に ... がないとだめ
  if b < c and d < c:
    flag = False
    for i in range(b-1, d):
      if s[i] == '.' and s[i+1] == '.' and s[i+2] == '.':
        flag = True
    if not flag:
      print('No')
      return
  print('Yes')

  return

if __name__ == "__main__":
  resolve() def resolve():
  n, a, b, c, d = map(int, input().split())
  a -= 1
  b -= 1
  c -= 1
  d -= 1
  s = input()

  # a と c の間に ## があったらだめ
  for i in range(a, c):
    if s[i] == '#' and s[i+1] == '#':
      print('No')
      return
  # b と d の間に ## があったらだめ
  for i in range(b, d):
    if s[i] == '#' and s[i+1] == '#':
      print('No')
      return
  # a が b を飛び越えないと行けない場合  b - d の間に ... がないとだめ
  if b < c and d < c:
    flag = False
    for i in range(b-1, d):
      if s[i] == '.' and s[i+1] == '.' and s[i+2] == '.':
        flag = True
    if not flag:
      print('No')
      return
  print('Yes')

  return resolve 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 for i in range(a, c):
    if s[i] == '#' and s[i+1] == '#':
      print('No')
      return
  # b と d の間に ## があったらだめ
   i range(a, c) range a c if s[i] == '#' and s[i+1] == '#':
      print('No')
      return
  # b と d の間に ## があったらだめ
   s[i] == '#' and s[i+1] == '#' s[i] == '#' s[i] s i '#' s[i+1] == '#' s[i+1] s i+1 i 1 '#' print('No') print 'No' return for i in range(b, d):
    if s[i] == '#' and s[i+1] == '#':
      print('No')
      return
  # a が b を飛び越えないと行けない場合  b - d の間に ... がないとだめ
   i range(b, d) range b d if s[i] == '#' and s[i+1] == '#':
      print('No')
      return
  # a が b を飛び越えないと行けない場合  b - d の間に ... がないとだめ
   s[i] == '#' and s[i+1] == '#' s[i] == '#' s[i] s i '#' s[i+1] == '#' s[i+1] s i+1 i 1 '#' print('No') print 'No' return if b < c and d < c:
    flag = False
    for i in range(b-1, d):
      if s[i] == '.' and s[i+1] == '.' and s[i+2] == '.':
        flag = True
    if not flag:
      print('No')
      return
   b < c and d < c b < c b c d < c d c flag = False flag False for i in range(b-1, d):
      if s[i] == '.' and s[i+1] == '.' and s[i+2] == '.':
        flag = True
     i range(b-1, d) range b-1 b 1 d if s[i] == '.' and s[i+1] == '.' and s[i+2] == '.':
        flag = True
     s[i] == '.' and s[i+1] == '.' and s[i+2] == '.' s[i] == '.' and s[i+1] == '.' s[i] == '.' s[i] s i '.' s[i+1] == '.' s[i+1] s i+1 i 1 '.' s[i+2] == '.' s[i+2] s i+2 i 2 '.' flag = True flag True if not flag:
      print('No')
      return
   not flag flag print('No') print 'No' return print('Yes') print 'Yes' return if __name__ == "__main__":
  resolve() __name__ == "__main__" __name__ "__main__" resolve() resolve def resolve():
  n, a, b, c, d = map(int, input().split())
  a -= 1
  b -= 1
  c -= 1
  d -= 1
  s = input()

  # a と c の間に ## があったらだめ
  for i in range(a, c):
    if s[i] == '#' and s[i+1] == '#':
      print('No')
      return
  # b と d の間に ## があったらだめ
  for i in range(b, d):
    if s[i] == '#' and s[i+1] == '#':
      print('No')
      return
  # a が b を飛び越えないと行けない場合  b - d の間に ... がないとだめ
  if b < c and d < c:
    flag = False
    for i in range(b-1, d):
      if s[i] == '.' and s[i+1] == '.' and s[i+2] == '.':
        flag = True
    if not flag:
      print('No')
      return
  print('Yes')

  return def resolve():
  n, a, b, c, d = map(int, input().split())
  a -= 1
  b -= 1
  c -= 1
  d -= 1
  s = input()

  # a と c の間に ## があったらだめ
  for i in range(a, c):
    if s[i] == '#' and s[i+1] == '#':
      print('No')
      return
  # b と d の間に ## があったらだめ
  for i in range(b, d):
    if s[i] == '#' and s[i+1] == '#':
      print('No')
      return
  # a が b を飛び越えないと行けない場合  b - d の間に ... がないとだめ
  if b < c and d < c:
    flag = False
    for i in range(b-1, d):
      if s[i] == '.' and s[i+1] == '.' and s[i+2] == '.':
        flag = True
    if not flag:
      print('No')
      return
  print('Yes')

  return resolve
def resolve():
  n, a, b, c, d = map(int, input().split())
  a -= 1
  b -= 1
  c -= 1
  d -= 1
  s = input()

  # a と c の間に ## があったらだめ
  for i in range(a, c):
    if s[i] == '#' and s[i+1] == '#':
      print('No')
      return
  # b と d の間に ## があったらだめ
  for i in range(b, d):
    if s[i] == '#' and s[i+1] == '#':
      print('No')
      return
  # a が b を飛び越えないと行けない場合  b - d の間に ... がないとだめ
  if b < c and d < c:
    flag = False
    for i in range(b-1, d):
      if s[i] == '.' and s[i+1] == '.' and s[i+2] == '.':
        flag = True
    if not flag:
      print('No')
      return
  print('Yes')

  return

if __name__ == "__main__":
  resolve()
