#include<bits/stdc++.h>
#define N 200005
#define re register
#define ll long long
#define P 998244353
using namespace std;
int n,m,K,q,u;
inline void Rd(int &res){
	re char c;res=0;bool f=0;
	while(c=getchar(),c<48)(c=='-')&&(f=1);
	do res=(res<<3)+(res<<1)+(c^48);
	while(c=getchar(),c>47);
	f&&(res=-res);
}
int f[25][5005];
int fac[N],fac1[N];
inline int C(int n,int m){
	if(n<m)return 0;
	return 1ll*fac[n]*fac1[m]%P*fac1[n-m]%P;
}
int Pow(int x,int k){
	int res=1;
	while(k){
		if(k&1)res=1ll*res*x%P;
		x=1ll*x*x%P;
		k>>=1;
	}
	return res;
}
int main(){
	Rd(n),Rd(m);
	fac[0]=1;for(re int i=1;i<N;i++)fac[i]=1ll*i*fac[i-1]%P;
	fac1[N-1]=Pow(fac[N-1],P-2);for(re int i=N-2;i>=0;i--)fac1[i]=1ll*(i+1)*fac1[i+1]%P;
	int t=1,cnt=0;
	while((t<<1)<=m)t<<=1,cnt++;
	f[cnt+2][0]=1;
	for(re int i=cnt+1;i>=0;i--){
		int res=(1<<i);
		for(re int j=0;j<=n&&res*j<=m;j+=2){
			for(re int k=0;k+res*j<=m;k++)if(f[i+1][k]){
				f[i][res*j+k]=(f[i][res*j+k]+1ll*f[i+1][k]*C(n,j))%P;
			}
		}
	}
	printf("%d\n",f[0][m]);
	return 0;
}
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <vector>
#include <bitset>
#include <string>
#include <cstring>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <utility>
#include <algorithm>
#include <random>
#include <cmath>
#include <cassert>
#include <climits>
#include <ctime>
#include <chrono>


/*
#pragma GCC optimize("Ofast")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,sse4.1,sse4.2,popcnt,abm,mmx,avx,avx2,tune=native")
*/


#ifdef LOCAL
    #define dbg(x) cout << #x << " : " << x << endl;
#else
    #define dbg(x)
#endif

#define int long long
#define pb push_back
#define ppb pop_back()
#define mp make_pair
#define fi(a, b) for (int i = a; i < b; i++)
#define fj(a, b) for (int j = a; j < b; j++)
#define fk(a, b) for (int k = a; k < b; k++)
#define fi1(a, b) for (int i = a - 1; i >= b; i--)
#define fj1(a, b) for (int j = a - 1; j >= b; j--)
#define fk1(a, b) for (int k = a - 1; k >= b; k--)
#define fx(x, a) for (auto& x : a)
#define rep(i, a, b) for (int i = a; i < b; ++i)
#define rep1(i, a, b) for (int i = a - 1; i >= b; --i)
#define siz(x) (int)x.size()
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
#define left leftkekmda
#define right rightkekmda

using namespace std;

template<typename T1, typename T2>inline void mine(T1 &x, const T2 &y) { if (y < x) x = y; }
template<typename T1, typename T2>inline void maxe(T1 &x, const T2 &y) { if (x < y) x = y; }

template<typename T> ostream& operator << (ostream &os, const vector<T> &b) {
    for (auto &k : b) os << k << ' ';
    return os;
}
template<typename T> istream& operator >> (istream &is, vector<T> &b) {
    for (auto &k : b) is >> k;
    return is;
}


typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef char ch;
typedef string str;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vpii;
typedef vector<vpii> vvpii;
typedef vector<ch> vch;
typedef vector<vch> vvch;
typedef vector<str> vs;


mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

const int N = 21;
int a[N];

int32_t main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    int n;
    cin >> n;
    fi(0, n) cin >> a[i];

    int ans = 1ll << 31;
    for (int mask = 1; mask < (1 << n); mask += 2) {
        int curb = 0;
        int curx = 0;
        for (int i = 0; i < n; ++i) {
            if ((mask >> i) & 1) {
                curx ^= curb;
                curb = 0;
            }
            curb |= a[i];
        }
        curx ^= curb;
        mine(ans, curx);
    }   
    cout << ans << '\n';
}
