#pragma GCC optimize("Ofast", "unroll-loops") #include using namespace std; int ipow(int a, int b){ if (b == 0) return 1; int tmp = ipow(a, b / 2); tmp = tmp * tmp; if (b % 2 == 0) return tmp; return tmp * a; } int N; vector E; void input(void){ cin >> N; E.resize(N); for (int& ei : E) cin >> ei; } bool _judge(int flg){ int pa = 0, pb = 0, pc = 0; for (int i = 0; i < N; ++i){ if (flg % 3 == 0) pa += E[i]; else if (flg % 3 == 1) pb += E[i]; else pc += E[i]; flg /= 3; } return (pa == pb && pb == pc); } bool judge(void){ int upper_flg = ipow(3, N); for (int flg = 0; flg < upper_flg; ++flg) if (_judge(flg)) return true; return false; } int main(void){ input(); if (judge()) cout << "Yes" << endl; else cout << "No" << endl; return 0; }