fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. using ll = long long;
  4.  
  5. signed main()
  6. {
  7. ios_base::sync_with_stdio(false);
  8. cin.tie(NULL), cout.tie(NULL);
  9. ll t, a, s;
  10. cin >> t;
  11. while (t--)
  12. {
  13. cin >> a >> s;
  14. if (s < 2 * a || (a ^ (s - a)) != (s - 2 * a))
  15. cout << "No" << '\n';
  16. else
  17. cout << "Yes" << '\n';
  18. }
  19. return 0;
  20. }
Success #stdin #stdout 0s 5324KB
stdin
2
1 8
4 2
stdout
Yes
No