#include using namespace std; typedef long long ll; ll mod = 998244353,a[300010],b[300010],sum = 0; ll pw(ll a,ll x){ a %= mod; ll ret = 1; while(x){ if(x&1) (ret *= a) %= mod; x /= 2; (a *= a) %= mod; } return ret; } int main(){ int i,j,n; cin >> n; if(n>18) exit(1); for(i=0;i<(1<> a[i]; if(a[i]>1000) exit(1); } for(i=0;i<(1<