import sys longth=int(input()) array=list(map(int,input().split())) time=int(input()) can=[] small=0 for i in range(longth):#找出所有连续零的最长长度 if array[i]==0: small+=1 else: can.append(small) small=0 can.append(small)#末尾不为零是记得加上最后的长度 result=[int((i-1)/2) for i in can]#各个长度的最大可以0换1的数目 print('true' if sum(result)>=time else 'false')