m = int(input()) s = input() n = int(input()) can = [int(len(x)/2) for x in s.replace(' ','').split('1') if x!=''] print('true' if sum(can)>=n else 'false')