#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<cassert>
using namespace std;

typedef long long ll;

typedef unsigned long long ul;
typedef unsigned int ui;
const ll mod = 998244353;
const ll INF = mod * mod;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef pair<ll, ll> LP;
typedef vector<LP> vec;
typedef vector<string> svec;
typedef long double ld;
typedef pair<ld, ld> LDP;
const ld eps = 1e-8;

struct F_2 {
	vector<int>  s;
	F_2(string t) {
		s.resize(t.length());
		rep(i, t.length()) {
			if (t[i] == '1')s[i] = 1;
			else s[i] = 0;
		}
	}
	F_2(int c) {
		s = { c };
	}
};
bool operator!=(const F_2 &a, const F_2 &b) {
	return a.s != b.s;
}
bool operator<=(const F_2 &a, const F_2 &b) {
	if (a.s.size() != b.s.size()) {
		return a.s.size() < b.s.size();
	}
	return a.s <= b.s;
}
F_2 operator-(const F_2 &a, const F_2 &b) {
	//assert(a.s.size()>=b.s.size())
	int len = b.s.size();
	F_2 ret = a;
	rep(i, len) {
		if (b.s[i]) {
			ret.s[i] ^= 1;
		}
	}
	rep(i, ret.s.size()) {
		if (ret.s[i] || i == (int)ret.s.size() - 1) {
			ret.s.erase(ret.s.begin(), ret.s.begin() + i);
			break;
		}
	}
	return ret;
}
F_2 operator+(const F_2 &a, const F_2 &b) {
	int l1 = a.s.size(), l2 = b.s.size();
	int len = max(a.s.size(), b.s.size());
	F_2 ret(0); ret.s.resize(len);
	rep(i, len) {
		int c = 0;
		if (i < l1&&a.s[l1 - 1 - i])c ^= 1;
		if (i < l2&&b.s[l2 - 1 - i])c ^= 1;
		ret.s[len - 1 - i] = c;
	}
	rep(i, ret.s.size()) {
		if (ret.s[i] || i == (int)ret.s.size() - 1) {
			ret.s.erase(ret.s.begin(), ret.s.begin() + i);
			break;
		}
	}
	return ret;
}
F_2 operator%(const F_2 &a, const F_2 &b) {
	F_2 ret = a;
	int len = b.s.size();
	while (ret.s.size() >= len&&ret!=0) {
		rep(i, len) {
			if(b.s[i])ret.s[i] ^= 1;
		}
		rep(i, ret.s.size()) {
			if (ret.s[i] || i == (int)ret.s.size() - 1) {
				ret.s.erase(ret.s.begin(), ret.s.begin() + i);
				break;
			}
		}
	}
	return ret;
}

F_2 gcd(F_2 a, F_2 b) {
	if (a.s.size() < b.s.size())swap(a, b);
	while (b!=0) {
		F_2 r = a % b; a = b; b = r;
		/*rep(i, b.s.size()) {
			cout << b.s[i];
		}
		cout << endl;*/
	}
	return a;
}

ll mod_pow(ll x, ll n) {
	ll ret = 1;
	while (n > 0) {
		if (n % 2)ret = ret * x%mod;
		x = x * x%mod; n >>= 1;
	}
	return ret;
}
void solve() {
	int n; string x; cin >> n >> x;
	F_2 s(x);
	F_2 g("0");
	rep(i, n) {
		string s; cin >> s;
		F_2 f(s);
		g = gcd(g, s);
	}
	ll ans = 0;
	F_2 cur("0");
	int dif = (int)s.s.size() - (int)g.s.size();
	if (dif < 0) {
		cout << 1 << endl; return;
	}
	for (int d = dif; d >= 0; d--) {
		int z = 0;
		if (cur.s.size() >= g.s.size() + d) {
			int len = cur.s.size();
			int id = len - (int)g.s.size() - d;
			if (cur.s[id])z = 1;
		}
		int l = s.s[dif - d];
		if (l == 1 && z == 1) {
			ans += mod_pow(2, d);
			if (ans >= mod)ans -= mod;
		}
		else if (l == 1 && z == 0) {
			ans += mod_pow(2, d);
			if (ans >= mod)ans -= mod;

			F_2 u = g;
			rep(i, d)u.s.push_back(0);
			cur = cur + u;
		}
		else if (l == 0 && z == 0) {
			continue;
		}
		else {
			F_2 u = g;
			rep(i, d)u.s.push_back(0);
			cur = cur + u;
		}

	}
	if (cur <= s)ans++;
	cout << ans % mod << endl;
}

signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);

	//cout << fixed << setprecision(10);
	//init();
	solve();
	//stop
		return 0;
}



Measured memory_bytes: 384