Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rep(i,j,n) for(int i=(int)(j);i<(int)(n);i++)
#define REP(i,j,n) for(int i=(int)(j);i<=(int)(n);i++)
#define MOD 1000000007
#define int long long
#define ALL(a) (a).begin(),(a).end()
#define vi vector<int>
#define vii vector<vi>
#define pii pair<int,int>
#define priq priority_queue<int>
#define disup(A,key) distance(A.begin(),upper_bound(ALL(A),(int)(key)))
#define dislow(A,key) distance(A.begin(),lower_bound(ALL(A),(int)(key)))
#define tii tuple<int,int,int>
#define Priq priority_queue<int,vi,greater<int>>
#define pb push_back
#define mp make_pair
#define INF (1ll<<60)
signed main(){
  int N,X; cin>>N>>X;
  if(X==1||X==2*N-1) cout<<"No"<<endl;
  else{
    cout<<"Yes"<<endl;
    deque ans;
    if(N<X){
      bool flag=1;
      for(int i=X+1;1<=i;i--){
        if(flag) ans.push_front(i);
        else ans.pb(i);
        flag=!flag;
      }
      for(int i=2*N-1;X+1<i;i--){
        if(flag) ans.push_front(i);
        else ans.pb(i);
        flag=!flag;
      }
    }
    else{
      bool flag=1;
      rep(i,X-1,2*N){
        if(flag) ans.push_front(i);
        else ans.pb(i);
        flag=!flag;
      }
      rep(i,1,X-1){
        if(flag) ans.push_front(i);
        else ans.pb(i);
        flag=!flag;
      }
    }
    rep(i,0,2*N-1) cout<<ans[i]<<" ";
    cout<<endl;
  }
  }


Compiler output:
a.cc: In function 'int main()':
a.cc:24:11: error: class template argument deduction failed:
   24 |     deque ans;
      |           ^~~
a.cc:24:11: error: no matching function for call to 'deque()'
In file included from /usr/include/c++/14/deque:66,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:139,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_deque.h:1003:9: note: candidate: 'template<class _Tp, class _Alloc, class _InputIterator, class> deque(_InputIterator, _InputIterator, const _Alloc&)-> std::deque<_Tp, _Alloc>'
 1003 |         deque(_InputIterator __first, _InputIterator __last,
      |         ^~~~~
/usr/include/c++/14/bits/stl_deque.h:1003:9: note:   candidate expects 2 arguments, 0 provided
/usr/include/c++/14/bits/stl_deque.h:976:7: note: candidate: 'template<class _Tp, class _Alloc> deque(std::initializer_list<_Tp>, const _Alloc&)-> std::deque<_Tp, _Alloc>'
  976 |       deque(initializer_list<value_type> __l,
      |       ^~~~~
/usr/include/c++/14/bits/stl_deque.h:976:7: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/stl_deque.h:952:7: note: candidate: 'template<class _Tp, class _Alloc> deque(std::deque<_Tp, _Alloc>&&, const _Alloc&, std::false_type)-> std::deque<_Tp, _Alloc>'
  952 |       deque(deque&& __x, const allocator_type& __a, false_type)
      |       ^~~~~
/usr/include/c++/14/bits/stl_deque.h:952:7: note:   candidate expects 3 arguments, 0 provided
/usr/include/c++/14/bits/stl_deque.h:948:7: note: candidate: 'template<class _Tp, class _Alloc> deque(std::deque<_Tp, _Alloc>&&, const _Alloc&, std::true_type)-> std::deque<_Tp, _Alloc>'
  948 |       deque(deque&& __x, const allocator_type& __a, true_type)
      |       ^~~~~
/usr/include/c++/14/bits/stl_deque.h:948:7: note:   candidate expects 3 arguments, 0 provided
/usr/include/c++/14/bits/stl_deque.h:943:7: note: candidate: 'template<class _Tp, class _Alloc> deque(std::deque<_Tp, _Alloc>&&, std::__type_identity_t<_Alloc>&)-> std::deque<_Tp, _Alloc>'
  943 |       deque(deque&& __x, const __type_identity_t<allocator_type>& __a)
      |       ^~~~~
/usr/include/c++/14/bits/stl_deque.h:943:7: note:   candidate expects 2 arguments, 0 provided
/usr/include/c++/14/bits/stl_deque.h:936:7: note: candidate: 'template<class _Tp, class _Alloc> deque(const std::deque<_Tp, _Alloc>&, std::__type_identity_t<_Alloc>&)-> std::deque<_Tp, _Alloc>'
  936 |       deque(const deque& __x, const __type_identity_t<allocator_type>& __a)
      |       ^~~~~
/usr/include/c++/14/bits/stl_deque.h:936:7: note:   candidate expects 2 arguments, 0 provided
/usr/include/c++/14/bits/stl_deque.h:933:7: note: candidate: 'template<class _Tp, class _Alloc> deque(std::deque<_Tp, _Alloc>&&)-> std::deque<_Tp, _Alloc>'
  933 |       deque(deque&&) = default;
      |       ^~~~~
/usr/include/c++/14/bits/stl_deque.h:933:7: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/stl_deque.h:917:7: note: candidate: 'template<class _Tp, class _Alloc> deque(const std::deque<_Tp, _Alloc>&)-> std::deque<_Tp, _Alloc>'
  917 |       deque(const deque& __x)
      |       ^~~~~
/usr/include/c++/14/bits/stl_deque.h:917:7: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/stl_deque.h:890:7: note: candidate: 'template<class _Tp, class _Alloc> deque(std::size_t, const _Tp&, const _Alloc&)-> std::deque<_Tp, _Alloc>'
  890 |       deque(size_type __n, const value_type& __value,
      |       ^~~~~
/usr/include/c++/14/bits/stl_deque.h:890:7: note:   candidate expects 2 arguments, 0 provided
/usr/include/c++/14/bits/stl_deque.h:878:7: note: candidate: 'template<class _Tp, class _Alloc> deque(std::size_t, const _Alloc&)-> std::deque<_Tp, _Alloc>'
  878 |       deque(size_type __n, const allocator_type& __a = allocator_type())
      |       ^~~~~
/usr/include/c++/14/bits/stl_deque.h:878:7: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/stl_deque.h:865:7: note: candidate: 'template<class _Tp, class _Alloc> deque(const _Alloc&)-> std::deque<_Tp, _Alloc>'
  865 |       deque(const allocator_type& __a)
      |       ^~~~~
/usr/include/c++/14/bits/stl_deque.h:865:7: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/stl_deque.h:855:7: note: candidate: 'template<class _Tp, class _Alloc> deque()-> std::deque<_Tp, _Alloc>'
  855 |       deque() = default;
      |       ^~~~~
/usr/include/c++/14/bits/stl_deque.h:855:7: note:   template argument deduction/substitution failed:
a.cc:24:11: note:   couldn't deduce template parameter '_Tp'
   24 |     deque ans;
      |           ^~~
/usr/include/c++/14/bits/stl_deque.h:788:11: note: candidate: 'template<class _Tp, class _Alloc> deque(std::deque<_Tp, _Alloc>)-> std::deque<_Tp, _Alloc>'
  788 |     class deque : protected _Deque_base<_Tp, _Alloc>
      |           ^~~~~
/usr/include/c++/14/bits/stl_deque.h:788:11: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/stl_deque.h:2277:5: note: candidate: 'template<class _InputIterator, class _ValT, class _Allocator, class, class> std::deque(_InputIterator, _InputIterator, _Allocator)-> deque<_ValT, _Allocator>'
 2277 |     deque(_InputIterator, _InputIterator, _Allocator = _Allocator())
      |     ^~~~~
/usr/include/c++/14/bits/stl_deque.h:2277:5: note:   candidate expects 2 arguments, 0 provided