Language: C++

#include <stdio.h>
#include <algorithm>
#include <unordered_map>
using namespace std;

bool Check(std::unordered_map<int, int>& dict) {
  if (dict.size() == 1 && dict.count(0)) {
    return true;
  }
  if (dict.size() == 2) {
    int x = dict.begin()->first, y = (dict.begin() + 1)->first;
    if (dict[x] > dict[y]) {
    	std::swap(x, y);
    }
    if (dict[x] * 2 == dict[y] && x == 0) {
      return true;
    }
  }
  if (dict.size() == 3) {
    int x = dict.begin()->first;
    int y = (dict.begin() + 1)->first;
    int z = (dict.begin() + 2)->first;
    if (dict[x] == dict[y] && dict[x] == dict[z] && ((x ^ y) == z)) {
      return true;
    }
  }
  return false;
}

int main() {
  int n;
  std::unordered_map<int, int> dict;
  for (int i = 0; i < n; i++) {
    int x;
    scanf("%d", &x);
    dict[x]++;
  }
  if (Check(dict)) {
    printf("Yes\n");
  } else {
    printf("No\n");
  }
  return 0;
}

Compiler output:
a.cc: In function 'bool Check(std::unordered_map<int, int>&)':
a.cc:11:52: error: no match for 'operator+' (operand types are 'std::unordered_map<int, int>::iterator' {aka 'std::__detail::_Insert_base<int, std::pair<const int, int>, std::allocator<std::pair<const int, int> >, std::__detail::_Select1st, std::equal_to<int>, std::hash<int>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<false, false, true> >::iterator'} and 'int')
   11 |     int x = dict.begin()->first, y = (dict.begin() + 1)->first;
      |                                       ~~~~~~~~~~~~ ^ ~
      |                                                 |    |
      |                                                 |    int
      |                                                 std::unordered_map<int, int>::iterator {aka std::__detail::_Insert_base<int, std::pair<const int, int>, std::allocator<std::pair<const int, int> >, std::__detail::_Select1st, std::equal_to<int>, std::hash<int>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<false, false, true> >::iterator}
In file included from /usr/include/c++/14/bits/stl_algobase.h:67,
                 from /usr/include/c++/14/algorithm:60,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_iterator.h:627:5: note: candidate: 'template<class _Iterator> constexpr std::reverse_iterator<_Iterator> std::operator+(typename reverse_iterator<_Iterator>::difference_type, const reverse_iterator<_Iterator>&)'
  627 |     operator+(typename reverse_iterator<_Iterator>::difference_type __n,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:627:5: note:   template argument deduction/substitution failed:
a.cc:11:54: note:   mismatched types 'const std::reverse_iterator<_Iterator>' and 'int'
   11 |     int x = dict.begin()->first, y = (dict.begin() + 1)->first;
      |                                                      ^
/usr/include/c++/14/bits/stl_iterator.h:1798:5: note: candidate: 'template<class _Iterator> constexpr std::move_iterator<_IteratorL> std::operator+(typename move_iterator<_IteratorL>::difference_type, const move_iterator<_IteratorL>&)'
 1798 |     operator+(typename move_iterator<_Iterator>::difference_type __n,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1798:5: note:   template argument deduction/substitution failed:
a.cc:11:54: note:   mismatched types 'const std::move_iterator<_IteratorL>' and 'int'
   11 |     int x = dict.begin()->first, y = (dict.begin() + 1)->first;
      |                                                      ^
a.cc:21:27: error: no match for 'operator+' (operand types are 'std::unordered_map<int, int>::iterator' {aka 'std::__detail::_Insert_base<int, std::pair<const int, int>, std::allocator<std::pair<const int, int> >, std::__detail::_Select1st, std::equal_to<int>, std::hash<int>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<false, false, true> >::iterator'} and 'int')
   21 |     int y = (dict.begin() + 1)->first;
      |              ~~~~~~~~~~~~ ^ ~
      |                        |    |
      |                        |    int
      |                        std::unordered_map<int, int>::iterator {aka std::__detail::_Insert_base<int, std::pair<const int, int>, std::allocator<std::pair<const int, int> >, std::__detail::_Select1st, std::equal_to<int>, std::hash<int>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<false, false, true> >::iterator}
/usr/include/c++/14/bits/stl_iterator.h:627:5: note: candidate: 'template<class _Iterator> constexpr std::reverse_iterator<_Iterator> std::operator+(typename reverse_iterator<_Iterator>::difference_type, const reverse_iterator<_Iterator>&)'
  627 |     operator+(typename reverse_iterator<_Iterator>::difference_type __n,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:627:5: note:   template argument deduction/substitution failed:
a.cc:21:29: note:   mismatched types 'const std::reverse_iterator<_Iterator>' and 'int'
   21 |     int y = (dict.begin() + 1)->first;
      |                             ^
/usr/include/c++/14/bits/stl_iterator.h:1798:5: note: candidate: 'template<class _Iterator> constexpr std::move_iterator<_IteratorL> std::operator+(typename move_iterator<_IteratorL>::difference_type, const move_iterator<_IteratorL>&)'
 1798 |     operator+(typename move_iterator<_Iterator>::difference_type __n,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1798:5: note:   template argument deduction/substitution failed:
a.cc:21:29: note:   mismatched types 'const std::move_iterator<_IteratorL>' and 'int'
   21 |     int y = (dict.begin() + 1)->first;
      |                             ^
a.cc:22:27: error: no match for 'operator+' (operand types are 'std::unordered_map<int, int>::iterator' {aka 'std::__detail::_Insert_base<int, std::pair<const int, int>, std::allocator<std::pair<const int, int> >, std::__detail::_Select1st, std::equal_to<int>, std::hash<int>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<false, false, true> >::iterator'} and 'int')
   22 |     int z = (dict.begin() + 2)->first;
      |              ~~~~~~~~~~~~ ^ ~
      |                        |    |
      |                        |    int
      |                        std::unordered_map<int, int>::iterator {aka std::__detail::_Insert_base<int, std::pair<const int, int>, std::allocator<std::pair<const int, int> >, std::__detail::_Select1st, std::equal_to<int>, std::hash<int>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<false, false, true> >::iterator}
/usr/include/c++/14/bits/stl_iterator.h:627:5: note: candidate: 'template<class _Iterator> constexpr std::reverse_iterator<_Iterator> std::operator+(typename reverse_iterator<_Iterator>::difference_type, const reverse_iterator<_Iterator>&)'
  627 |     operator+(typename reverse_iterator<_Iterator>::difference_type __n,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:627:5: note:   template argument deduction/substitution failed:
a.cc:22:29: note:   mismatched types 'const std::reverse_iterator<_Iterator>' and 'int'
   22 |     int z = (dict.begin() + 2)->first;
      |                             ^
/usr/include/c++/14/bits/stl_iterator.h:1798:5: note: candidate: 'template<class _Iterator> constexpr std::move_iterator<_IteratorL> std::operator+(typename move_iterator<_IteratorL>::difference_type, const move_iterator<_IteratorL>&)'
 1798 |     operator+(typename move_iterator<_Iterator>::difference_type __n,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1798:5: note:   template argument deduction/substitution failed:
a.cc:22:29: note:   mismatched types 'const std::move_iterator<_IteratorL>' and 'int'
   22 |     int z = (dict.begin() + 2)->first;
      |                             ^