#include using namespace std; int main() { int T, i, n,m; bool flag1, flag2; cin >> T; while (T--) { flag1 = flag2 = 0; cin >> n; for (i = 0; i < n; i++) { cin >> m; if (m == 0) flag1 = 1; else if (m == 1) flag2 = 1; } if (flag1&&flag2) cout << "YES" << endl; else cout << "NO" << endl; } return 0; }