Language: C++

#include <bits/stdc++.h>                                                                
                                                                                        
using namespace std;                                                                    
                                                                                        
#define all(x) x.begin(), x.end()                                                       
#define rep(i, n) for (int i = 0; i < n; ++i)                                           
#define reps(i, m, n) for (int i = m; i <= n; ++i)                                      
                                                                                        
using i64 = long long;                                                                  
using pii = pair<i64, i64>;                                                             
                                                                                        
template<class A, class B>inline bool chmax(A &a, const B &b){return b > a ? a = b,1 : 0
template<class A, class B>inline bool chmin(A &a, const B &b){return b < a ? a = b,1 : 0
                                                                                        
constexpr int INF = 0x3f3f3f3f;                                                         
constexpr i64 LINF = 0x3f3f3f3f3f3f3f3fLL;                                              
constexpr int MOD = int(1e9) + 7;                                                       
                                                                                        
signed main()                                                                           
{                                                                                       
  ios::sync_with_stdio(false);                                                          
  cin.tie(nullptr);                                                                     
                                                                                        
  i64 n, k;                                                                             
  cin >> n >> k;                                                                        
                                                                                        
  int sumdiff = 0;                                                                      
  vector<int> a(n+5);                                                                   
  rep(i, n) {                                                                           
    cin >> a[i];                                                                        
    if (a[i] == k) {                                                                    
      cout << "POSSIBLE" << "\n";                                                       
      return 0;                                                                         
    }                                                                                   
    sumdiff = abs(sumdiff - a[i]);                                                      
  }                                                                                     
                                                                                        
  for (int i = 0; i < n; ++i) {                                                         
    if (abs(a[i] - sumdiff) == k) {                                                     
      cout << "POSSIBLE" << "\n";                                                       
      return 0;                                                                         
    }                                                                                   
  }                                                                                     
                                                                                        
  cout << "IMPOSSIBLE" << "\n";                                                         
                                                                                        
  return 0;                                                                             
}                                                                                       

Compiler output:
a.cc: In function 'bool chmax(A&, const B&)':
a.cc:12:89: error: expected ';' before 'template'
   12 | template<class A, class B>inline bool chmax(A &a, const B &b){return b > a ? a = b,1 : 0
      |                                                                                         ^
      |                                                                                         ;
   13 | template<class A, class B>inline bool chmin(A &a, const B &b){return b < a ? a = b,1 : 0
      | ~~~~~~~~                                                                                 
a.cc:13:1: error: a template declaration cannot appear at block scope
   13 | template<class A, class B>inline bool chmin(A &a, const B &b){return b < a ? a = b,1 : 0
      | ^~~~~~~~
a.cc:48:2: error: expected '}' at end of input
   48 | }
      |  ^
a.cc:12:62: note: to match this '{'
   12 | template<class A, class B>inline bool chmax(A &a, const B &b){return b > a ? a = b,1 : 0
      |                                                              ^