//#include <bits/stdc++.h>
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
//#include "boost/multiprecision/cpp_int.hpp"
//typedef boost::multiprecision::cpp_int ll;
typedef long double dd;
//#define i_7 (ll)(1E9+7)
#define i_7 998244353
#define i_5 i_7-2

ll mod(ll a){
    ll c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
typedef pair<ll,ll> l_l;
typedef pair<dd,dd> d_d;
ll inf=(ll)1E16;
#define rep(i,l,r) for(ll i=l;i<=r;i++)
#define pb push_back
ll max(ll a,ll b){if(a<b)return b;else return a;}
ll min(ll a,ll b){if(a>b)return b;else return a;}
void Max(ll &pos,ll val){pos=max(pos,val);}//Max(dp[n],dp[n-1]);
void Min(ll &pos,ll val){pos=min(pos,val);}
void Add(ll &pos,ll val){pos=mod(pos+val);}
dd EPS=1E-9;
#define fastio ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define fi first
#define se second
#define endl "\n"
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())
//template<class T>void max(T a,T b){if(a<b)return b;else return a;}
//template<class T>void min(T a,T b){if(a>b)return b;else return a;}
//template<class T>bool Max(T&a, T b){if(a < b){a = b;return 1;}return 0;}
//template<class T>bool Min(T&a, T b){if(a > b){a = b;return 1;}return 0;}

//////////////////////////
//区間和
struct RSQ{
    ll n;
    vector<ll>data;
    /*
    RSQ(ll vs){
        n=1;
        while(n<vs)n*=2;
        data.resize(2*n-1,0);
    }*/
    void init(ll vs){
        n=1;
        while(n<vs)n*=2;
        data.resize(2*n-1,0);
    }
    void update(ll k,ll a){
        k+=n-1;
        data[k]=a;
        while(k>0){
            k=(k-1)/2;
            data[k]=mod(data[2*k+1]+data[2*k+2]);
        }
    }
    /*
    void add(ll k,ll a){
        k+=n-1;
        //data[k]+=a;
        Add(data[k],a);
        while(k>0){
            k=(k-1)/2;
            data[k]=mod(data[2*k+1]+data[2*k+2]);
        }
    }*/
    ll query(ll a,ll b,ll k,ll l,ll r){
        if(r<=a||b<=l)return 0;
        if(a<=l&&r<=b){
            return data[k];
        }else{
            ll vl=query(a,b,2*k+1,l,(l+r)/2);
            ll vr=query(a,b,2*k+2,(l+r)/2,r);
            return mod (vl+vr);
        }
    }
    ll query(ll a,ll b){return query(a,b,0,0,n);}//[a,b)の和
};
//////////////////////////////////////////////////////

ll n,x;
void solve(){
    ll y=511;
    //vector<RSQ>u[2];
    //rep(i,0,1)u[i].resize(y+1);
    //rep(i,0,1)rep(j,0,y)u[i][j].init(x+1);
    //rep(j,0,x)cout<<u[1][x].query(j,j+1)<<" ";
    ll u[2][y+1][x+1];memset(u,0,sizeof(u));
    rep(k,0,x)u[0][0][k]=1;
    //u[0][0].update(0,1);
    rep(i,1,n){
        //rep(j,0,y)rep(k,0,x)dp[i&1][j][k]=0;
        rep(j,0,y){
            rep(k,0,x){
                //if(0<=(j^k)&&(j^k)<=y)u[i&1][j].update(k,u[(i-1)&1][j^k].query(0,k+1));
                if(0<=(j^k)&&(j^k)<=y)u[i&1][j][k]=u[(i-1)&1][j^k][k];
            }
        }
        rep(j,0,y)rep(k,1,x)Add(u[i&1][j][k],u[i&1][j][k-1]);
        /*
        rep(j,0,3){
            rep(k,0,x){
                cout<<u[i&1][j][k]<<" ";
            }cout<<endl;
        }cout<<endl;*/
        
        /*
        rep(j,0,x){
            rep(k,0,x){
                cout<<u[i&1][j].query(k,k+1)<<" ";
            }cout<<endl;
        }cout<<endl;
         */
    }
    cout<<mod(u[n&1][x][x])<<endl;
    //cout<<mod(u[n&1][x].query(0,x+1))<<endl;
}

int main(){fastio
    cin>>n>>x;
    solve();
    /*
    ll dp[n+1][x+1][x+1];memset(dp,0,sizeof(dp));
    dp[0][0][0]=1;
    rep(i,1,n){
        rep(j,0,x){
            rep(k,0,x){
                rep(s,0,k){
                    if(j^k<=x)dp[i][j][k]+=dp[i-1][j^k][s];
                }
            }
        }
    }*/
    
    return 0;
}



Measured memory_bytes: 7144