n = int(input()) # 数据个数 ls = list(map(int, input().split())) q3 = [] q5 = [] q = [] for i in ls: if i % 3 == 0: q3.append(i) elif i % 5 == 0: q5.append(i) else: q.append(i) def f(three, five, other): if len(other) == 0: if sum(three) == sum(five): return True else: return False return f((five + [other[0]]), three, other[1:]) or f( five, (three + [other[0]]), other[1:] ) if f(q3, q5, q): print("true") else: print("false")