You're given a row with $n$ chairs. We call a seating of people "maximal" if the two following conditions hold:  There are no neighbors adjacent to anyone seated.  It's impossible to seat one more person without violating the first rule. 

The seating is given as a string consisting of zeros and ones ($0$ means that the corresponding seat is empty, $1$ — occupied). The goal is to determine whether this seating is "maximal".

Note that the first and last seats are not adjacent (if $n \ne 2$).


-----Input-----

The first line contains a single integer $n$ ($1 \leq n \leq 1000$) — the number of chairs.

The next line contains a string of $n$ characters, each of them is either zero or one, describing the seating.


-----Output-----

Output "Yes" (without quotation marks) if the seating is "maximal". Otherwise print "No".

You are allowed to print letters in whatever case you'd like (uppercase or lowercase).


-----Examples-----
Input
3
101

Output
Yes

Input
4
1011

Output
No

Input
5
10001

Output
No



-----Note-----

In sample case one the given seating is maximal.

In sample case two the person at chair three has a neighbour to the right.

In sample case three it is possible to seat yet another person into chair three.

Difficulty: interview

Starter code:

Solutions:
n = int(input())
a = '0'+input()+'0'
if '000' in a or '11' in a:print('No')
else:print('Yes')


input()
s = '0' + input() + '0'
if '11' in s:
    print('No')
    return
if '000' in s:
    print('No')
    return
print('Yes')

n = int(input())
s = input()
ok = 1
for i in range(n):
	if s[i] == '1':
		if i > 0:
			ok &= s[i - 1] == '0'
		if i < n - 1:
			ok &= s[i + 1] == '0'
	else:
		res = 0
		if i > 0:
			res |= s[i - 1] == '1'
		if i < n - 1:
			res |= s[i + 1] == '1'
		ok &= res
print("Yes" if ok else "No")

n = int(input())
a = input()
e = True
if (n == 1 and a == "0"):
    e = False
if (n > 1 and (a[0] == a[1] == '0' or a[n - 1] == a[n - 2] == '0')):
    e = False
for i in range(1, n):
    if (a[i - 1] == a[i] == '1'):
        e = False
for i in range(2, n):
    if (a[i - 2] == a[i - 1] == a[i] == '0'):
        e = False
if (e):
    print("Yes")
else:
    print("No")

n = int(input())
s = input()[:n]
for i in range(len(s)):
    if s[i] == '1':
        if i - 1 >= 0 and s[i - 1] != '0':
            print("No")
            return
        if i + 1 < len(s) and s[i + 1] != '0':
            print("No")
            return
    elif s[i] == '0':
        if (i - 1 < 0 or s[i - 1] == '0') and (i + 1 >= len(s) or s[i + 1] == '0'):
            print("No")
            return
print("Yes")


a=input()
b=input()+'0'
zeros=1
ans=True
for c in b:
    if c== '1':
        if zeros == 0:
            ans=False
        zeros=0
    else:
        zeros = zeros+1
        if zeros >2:
            ans=False

if ans:
    print("Yes")
else:
    print("No")

n = int(input())
n += 2
st = input()
st = '0'+  st + '0'
cond = True
for i in range(1, n):
    if st[i] == st[i - 1] and st[i] == '1':
        cond = False
if cond and (st.count('000') == 0):
    print('Yes')
else:
    print('No')


n = int(input())
s = '0' + input() + '0'
if '000' in s or '11' in s:
    print ('No')
else:
    print ('Yes')


n = int(input())
s = input()
ok = True
for i in range(len(s) - 1):
	if s[i] == '1' and s[i + 1] == '1':
		ok = False
	if i + 2 < len(s):
		if s[i] == '0' and s[i + 1] == '0' and s[i + 2] == '0':
			ok = False
if len(s) >= 2:
	if s[0] == '0' and s[1] == '0':
		ok = False
	if s[-1] == '0' and s[-2] == '0':
		ok = False
else:
	ok = (s[0] == '1')
print('Yes' if ok else 'No')

input()
s = input()
ok = True
for i in range(len(s)):
    l = r = True
    if i > 0:
        l = s[i-1] == '0'
    if i < len(s)-1:
        r = s[i+1] == '0'
    if s[i] == '0' and l and r:
        ok = False
    if s[i] == '1' and (not l or not r):
        ok = False
    if not ok:
        break
print('Yes' if ok else 'No')

n = int(input())
s = '0' + input() + '0'

ok = True
for i in range(1, n+1):
    if s[i] == '0':
        if s[i-1] == s[i+1] == '0':
            ok = False
    else:
        if s[i-1] == '1' or s[i+1] == '1':
            ok = False

if ok:
    print("Yes")
else:
    print("No")


n = int(input())
s = input()

if(len(s) == 1):
    if(s[0] == '1'):
        print('Yes')
    else:
        print('No')
else:
    if('000' in s or s[0] + s[1] == '00' or s[-1] + s[-2] == '00' or '11' in s  ):
        print('No')
    else:
        print('Yes')

def check(s):
    s = '0' + s + '0'
    for i in range(1, len(s) - 1):
        if s[i] == '1' and (s[i - 1] == '1' or s[i + 1] == '1'):
            return False
        if s[i] == '0' and s[i - 1] == '0' and s[i + 1] == '0':
            return False
    return True

n = int(input())
s = input()
if check(s):
    print('Yes')
else:
    print('No')


#!/usr/bin/env python3

n = int(input().strip())
s = input().strip()

def solve(n, s):
	if '11' in s:
		return False
	if '000' in s:
		return False
	if s.endswith('00') or s.startswith('00'):
		return False
	if s == '0':
		return False
	return True
	
if solve(n, s):
	print ('Yes')
else:
	print ('No')


n = int(input())
s = input()

ans = "Yes"
if n == 1:
  if s == '0':
    ans = "No"
else:
  if s[0] == s[1]:
    ans = "No"
  if s[-1] == s[-2]:
    ans = "No"
  for i in range(1, n - 1):
    if s[i] == '1' and (s[i - 1] == '1' or s[i + 1] == '1'):
      ans = "No"
    if s[i] == '0' and s[i - 1] == '0' and s[i + 1] == '0':
      ans = "No"
    
print(ans)    

n = int(input())
s = input()
i = 2
ans = 1
while i < n:
    if s[i] == s[i-1] and s[i] == "1":
        ans = 0
        break
    if s[i] == s[i-1] and s[i] == s[i-2]:
        ans = 0
        break
    i+= 1
if n > 1 and s[0] == s[1]:
    ans = 0
if n > 1 and s[n-1] == s[n-2]:
    ans = 0
if n == 1 and s[0] == "0":
    ans = 0
if ans == 1:
    print("Yes")
else:
    print("No")
    
    


n = int(input())
chairs = input()
if n > 2:
    if chairs.startswith('00') or chairs.endswith('00'):
        print('No')
    elif '000' in chairs or '11' in chairs:
        print('No')
    else:
        print('Yes')
else:
    if chairs == '00' or chairs == '11' or chairs == '0':
        print('No')
    else:
        print('Yes')

# your code goes here
N = int(input())

chairs = input()

ones = 0
zeros = 1
flag = 1
for i in range(N):
	if chairs[i] == '0':
		zeros += 1
		ones = 0
		if zeros == 3:
			print("No")
			flag = 0
			break
	elif chairs[i] == '1':
		ones += 1
		zeros = 0
		if ones == 2:
			print('No')
			flag = 0
			break
	else:
		ones = 0
		zeros = 0
if zeros == 2:
	print('No')
elif flag == 1:
	print('Yes')

n=int(input())
ns=input()

def fun():
    if n==1:
        if ns[0]=='1':
            return 'Yes'
        else:
            return 'No'
    for i  in range(1,n):
        if ns[i]=='1' and ns[i-1]=='1':
            return('No')
    if n>=2:
        if ns[0] == '0' and ns[1] == '0':
            return 'No'
        if ns[-1] == '0' and ns[-2] == '0':
            return 'No'
    num=0
    for c in ns:
        if c=='0':
            num+=1
        if c=='1':
            num=0
        if num>2:
            return('No')
    if num>2:
        return 'No'
    return 'Yes'
print(fun())

input()
s = input()
if s == '0':
    print('No')
elif (s.startswith('00') or s.endswith('00')):
    print('No')
else:
    print("No" if (s.find('11') != -1 or s.find('000') != -1) else "Yes")


n = int(input())
s = input()

result = True

if(n==1 and s=='0'):
	result = False

if("11" in s or "000" in s):
	result = False

if(s[0:2] == "00" or s[n-2:n] == "00"):
	result = False

if(result):
	print("Yes")
else:
	print("No")

n = int(input())
s = input()
i = 0
res = True
count = 0
while(i<n):
  if s[i]=='1':
    if count>2 or (i!=0 and count==0):
      res = False
      break
    count=0
  else:
    count+=1
  i+=1
if (n==1 and s[0]=='0') or (n>1 and s[0]=='0' and s[1]=='0'):
  res = False
if count>=2:
  res = False
if res:
  print('Yes')
else:
  print('No')

"""Problem A - Row.

http://codeforces.com/contest/982/problem/0

You're given a row with `n` chairs. We call a seating of people "maximal" if
the two following conditions hold:

1. There are no neighbors adjacent to anyone seated.

2. It's impossible to seat one more person without violating the first rule.

The seating is given as a string consisting of zeros and ones (`0` means that
the corresponding seat is empty, `1` — occupied). The goal is to determine
whether this seating is "maximal".

Note that the first and last seats are not adjacent (if `n != 2`).

Input:

The first line contains a single integer `n` (`1 \leq n \leq 1000`) — the
number of chairs.

The next line contains a string of `n` characters, each of them is either zero
or one, describing the seating.

Output:

Output "Yes" (without quotation marks) if the seating is "maximal". Otherwise
print "No".

You are allowed to print letters in whatever case you'd like (uppercase or
lowercase).

"""
import logging


fmt = '%(levelname)s - %(name)s (line:%(lineno)s) - %(message)s'
formatter = logging.Formatter(fmt)

ch = logging.StreamHandler()
ch.setLevel(logging.NOTSET)
ch.setFormatter(formatter)

logger = logging.getLogger('row')
logger.setLevel(logging.NOTSET)
logger.addHandler(ch)


def solve(s):
    if len(s) == 1 and s == '0':
        return False  # Its possible to seat someone
    elif len(s) == 1 and s == '1':
        return True
    elif len(s) == 2 and '1' in s and '0' in s:
        return True  # maximal
    if '11' in s:
        return False
    if '000' in s or s[:2] == '00' or s[-2:] == '00':
        return False  # Its possible to seat someone
    # raise 'Missing something?'
    return True


def main():
    _ = input()
    s = input()
    result = solve(s)
    print('Yes' if result else 'No')


def __starting_point():
    main()

__starting_point()

n = int(input())
s = '0' + input() + '0'

if s == "00":
    print("No")

else:
    if "000" in s or "11" in s:
        print("No")
    else:
        print("Yes")