fork(1) download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5. int t;
  6. cin >> t;
  7. while(t--)
  8. {
  9. int n,c=0;
  10. cin >> n;
  11. for(int i=1;i<=n;i++)
  12. {
  13. int a;
  14. cin >> a;
  15. if((a+i)%2==0)
  16. {
  17. c++;
  18. }
  19. }
  20. if(c==n)
  21. {
  22. cout << "YES" << endl;
  23. }
  24. else
  25. {
  26. cout << "NO" << endl;
  27. }
  28. }
  29. return 0;
  30. }
Success #stdin #stdout 0s 5324KB
stdin
2
4
1 2 3 4
3
1 1 1
stdout
YES
NO