#include using namespace std; int main() { int T; cin >> T; for (int i = 0; i < T; i++) { int N; cin >> N; priority_queue que; for (int j = 0; j < N; j++) { int A; cin >> A; que.push(A); } while (que.size() >= 3) { vector three(3); for (int j = 0; j < 3; j++) { three[j] = que.top(); que.pop(); } for (int j = 0; j < 3; j++) { if (three[j] - three[2] >= 1) { que.push(three[j] - three[2]); } } } if (que.size() == 0) { cout << "Yes\n"; } else { cout << "No\n"; } } }