import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        while(in.hasNextInt()){
            int n = in.nextInt();
            ArrayList<Integer> list = new ArrayList();
            int sum3=0, sum5=0, sum=0;
            for(int i=0;i<n;i++){
                int t = in.nextInt();
                if(t%5 == 0){
                    sum5 += t;
                }else if(t%3 == 0){
                    sum3 += t;
                }else{
                    sum += t;
                    list.add(t);
                }
            }
            int targe = Math.abs(sum5-sum3);   // 按5的倍数和3的倍数分组时,两组的差值targe
            if(sum == targe){  // 差值与剩余数的总和相等,即可以分组,直接把所有的数放在较小值那一组即可
                System.out.println("true");
                continue;
            }
            System.out.println(Judge(list,targe));
        }
    }
    //************************************************ 判断是否可分组
    // 把剩余数按所有情况分组,当两组的差值与targe相等时,即可正确分组
    public static boolean Judge(ArrayList<Integer> list, int targe){
        for(int i=0;i<list.size()-1;i++){
            for(int j=i+1;j<list.size();j++){
                List<Integer> list1 = list.subList(i,j);       // 将list分为两组,list1和(list2+list3)
                List<Integer> list2 = list.subList(0,i);
                List<Integer> list3 = list.subList(j,list.size());
                if(Math.abs(Sum(list1)-Sum(list2)-Sum(list3)) == targe){  // 当两组的差值等于targe时,可以正确分组
                    return true;
                }
            }
        }
        return false;
    }
    //************************************************ 计算总和
    public static int Sum(List<Integer> list){
        int sum = 0;
        for(int i=0;i<list.size();i++){
            sum += list.get(i);
        }
        return sum;
    }
}