Language: C++

#include <iostream> // cin, cout, cerr, clog
#include <algorithm> // minmax, sort, swap
#include <numeric> // iota, accumulate, inner_product
#include <cstdio> // printf, scanf
#include <climits> // INT_MIN, LLONG_MIN
#include <cmath> // long, trig, pow
#include <string> // string, stoi, to_string
#include <vector> // vector
#include <queue> // queue, priority_queue
#include <deque> // deque
#include <stack> // stack
#include <map> // key-value pairs sorted by keys
#include <set> // set
#include <unordered_map> // hashed by keys
#include <unordered_set> // hashed by keys
#include <iomanip> // cout<<setprecision(n)
#include <functional> // std::function<void(int)>

#define rep(i,n) for(int i = 0; i < (n); i++)
#define ENDL '\n'
#define print(i) std::cout << (i) << '\n'

#define int long long // at least int64 > 9*10^18
#define all(v) (v).begin(), (v).end()
/* libraries */

struct FastIO
{
  FastIO() {
    std::cin.tie(0);
    std::ios_base::sync_with_stdio(0); 
  }
} fastio;

int zpowl(int v,int k) { int r(1),t(v); while(k){ if(k&1) r*=t; t*=t; k>>=1; } return r; }

signed main() {
	int n;
	std::cin >> n;
	int m = zpowl(2,n);
	std::vector<int> s(m);
	rep(i,m) std::cin >> s[i];
	std::multiset<int,std::greater<int> > set(s);
	std::vector<int> created;
	auto it = set.begin();
	created.emplace_back(*it);
	set.erase(it);
	rep(i,n) {
		for(int c:created) {
			auto it = set.upper_bound(c);
			if(it==set.end()) {
				print("No");
				return 0;
			}
			created.emplace_back(*it);
			set.erase(it);
		}
	}
	print("Yes");

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:43:52: error: no matching function for call to 'std::multiset<long long int, std::greater<long long int> >::multiset(std::vector<long long int>&)'
   43 |         std::multiset<int,std::greater<int> > set(s);
      |                                                    ^
In file included from /usr/include/c++/14/set:64,
                 from a.cc:13:
/usr/include/c++/14/bits/stl_multiset.h:269:9: note: candidate: 'template<class _InputIterator> std::multiset<_Key, _Compare, _Alloc>::multiset(_InputIterator, _InputIterator, const allocator_type&) [with _Key = long long int; _Compare = std::greater<long long int>; _Alloc = std::allocator<long long int>]'
  269 |         multiset(_InputIterator __first, _InputIterator __last,
      |         ^~~~~~~~
/usr/include/c++/14/bits/stl_multiset.h:269:9: note:   candidate expects 3 arguments, 1 provided
/usr/include/c++/14/bits/stl_multiset.h:204:9: note: candidate: 'template<class _InputIterator> std::multiset<_Key, _Compare, _Alloc>::multiset(_InputIterator, _InputIterator, const _Compare&, const allocator_type&) [with _Key = long long int; _Compare = std::greater<long long int>; _Alloc = std::allocator<long long int>]'
  204 |         multiset(_InputIterator __first, _InputIterator __last,
      |         ^~~~~~~~
/usr/include/c++/14/bits/stl_multiset.h:204:9: note:   candidate expects 3 arguments, 1 provided
/usr/include/c++/14/bits/stl_multiset.h:188:9: note: candidate: 'template<class _InputIterator> std::multiset<_Key, _Compare, _Alloc>::multiset(_InputIterator, _InputIterator) [with _Key = long long int; _Compare = std::greater<long long int>; _Alloc = std::allocator<long long int>]'
  188 |         multiset(_InputIterator __first, _InputIterator __last)
      |         ^~~~~~~~
/usr/include/c++/14/bits/stl_multiset.h:188:9: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_multiset.h:263:7: note: candidate: 'std::multiset<_Key, _Compare, _Alloc>::multiset(std::initializer_list<_Tp>, const allocator_type&) [with _Key = long long int; _Compare = std::greater<long long int>; _Alloc = std::allocator<long long int>; allocator_type = std::allocator<long long int>]'
  263 |       multiset(initializer_list<value_type> __l, const allocator_type& __a)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_multiset.h:263:7: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_multiset.h:257:7: note: candidate: 'std::multiset<_Key, _Compare, _Alloc>::multiset(std::multiset<_Key, _Compare, _Alloc>&&, std::__type_identity_t<_Alloc>&) [with _Key = long long int; _Compare = std::greater<long long int>; _Alloc = std::allocator<long long int>; std::__type_identity_t<_Alloc> = std::allocator<long long int>]'
  257 |       multiset(multiset&& __m, const __type_identity_t<allocator_type>& __a)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_multiset.h:257:7: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_multiset.h:252:7: note: candidate: 'std::multiset<_Key, _Compare, _Alloc>::multiset(const std::multiset<_Key, _Compare, _Alloc>&, std::__type_identity_t<_Alloc>&) [with _Key = long long int; _Compare = std::greater<long long int>; _Alloc = std::allocator<long long int>; std::__type_identity_t<_Alloc> = std::allocator<long long int>]'
  252 |       multiset(const multiset& __m,
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_multiset.h:252:7: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_multiset.h:248:7: note: candidate: 'std::multiset<_Key, _Compare, _Alloc>::multiset(const allocator_type&) [with _Key = long long int; _Compare = std::greater<long long int>; _Alloc = std::allocator<long long int>; allocator_type = std::allocator<long long int>]'
  248 |       multiset(const allocator_type& __a)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_multiset.h:248:38: note:   no known conversion for argument 1 from 'std::vector<long long int>' to 'const std::multiset<long long int, std::greater<long long int> >::allocator_type&' {aka 'const std::allocator<long long int>&'}
  248 |       multiset(const allocator_type& __a)
      |                ~~~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_multiset.h:240:7: note: candidate: 'std::multiset<_Key, _Compare, _Alloc>::multiset(std::initializer_list<_Tp>, const _Compare&, const allocator_type&) [with _Key = long long int; _Compare = std::greater<long long int>; _Alloc = std::allocator<long long int>; allocator_type = std::allocator<long long int>]'
  240 |       multiset(initializer_list<value_type> __l,
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_multiset.h:240:45: note:   no known conversion for argument 1 from 'std::vector<long long int>' to 'std::initializer_list<long long int>'
  240 |       multiset(initializer_list<value_type> __l,
      |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_multiset.h:228:7: note: candidate: 'std::multiset<_Key, _Compare, _Alloc>::multiset(std::multiset<_Key, _Compare, _Alloc>&&) [with _Key = long long int; _Compare = std::greater<long long int>; _Alloc = std::allocator<long long int>]'
  228 |       multiset(multiset&&) = default;
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_multiset.h:228:16: note:   no known conversion for argument 1 from 'std::vector<long long int>' to 'std::multiset<long long int, std::greater<long long int> >&&'
  228 |       multiset(multiset&&) = default;
      |                ^~~~~~~~~~
/usr/include/c++/14/bits/stl_multiset.h:219:7: note: candidate: 'std::multiset<_Key, _Compare, _Alloc>::multiset(const std::multiset<_Key, _Compare, _Alloc>&) [with _Key = long long int; _Compare = std::greater<long long int>; _Alloc = std::allocator<long long int>]'
  219 |       multiset(const multiset&) = default;
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_multiset.h:219:16: note:   no known conversion for argument 1 from 'std::vector<long long int>' to 'const std::multiset<long long int, std::greater<long long int> >&'
  219 |       multiset(const multiset&) = default;
      |                ^~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_multiset.h:174:7: note: candidate: 'std::multiset<_Key, _Compare, _Alloc>::multiset(const _Compare&, const allocator_type&) [with _Key = long long int; _Compare = std::greater<long long int>; _Alloc = std::allocator<long long int>; allocator_type = std::allocator<long long int>]'
  174 |       multiset(const _Compare& __comp,
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_multiset.h:174:32: note:   no known conversion for argument 1 from 'std::vector<long long int>' to 'const std::greater<long long int>&'
  174 |       multiset(const _Compare& __comp,
      |                ~~~~~~~~~~~~~~~~^~~~~~
/usr/include/c++/14/bits/stl_multiset.h:165:7: note: candidate: 'std::multiset<_Key, _Compare, _Alloc>::multiset() [with _Key = long long int; _Compare = std::greater<long long int>; _Alloc = std::allocator<long long int>]'
  165 |       multiset() = default;
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_multiset.h:165:7: note:   candidate expects 0 arguments, 1 provided