#include #include #include using namespace std; using namespace atcoder; using mint = modint998244353; #define rep(i,n) for (int i = 0; i < (n); ++i) #define Inf32 1000000001 #define Inf64 4000000000000000001 int main(){ int _t; cin>>_t; rep(_,_t){ int n; cin>>n; vector a(n); rep(i,n){ scanf("%d",&a[i]); } int c = 0; rep(i,n-1){ if(a[i]!=a[i+1])c++; } if(c%2==1){ cout<<"Yes"<