#include<bits/stdc++.h>
#define int long long
using namespace std;
const int mod = 1e9 + 7, maxN = 1e5 + 13;
int n, x, dp[maxN], dpw[maxN];
vector<int> vec;
int pw (int a, int b) {
    int ret = 1;
    for (; b; b >>= 1, a = 1ll * a * a % mod)
	if (b & 1)
	    ret = 1ll * ret * a % mod;
    return ret;
}

					
int32_t main () {
    cin >> n >> x;
    int cur = 1;
    for (int i = 0; i < n; i++) {
	int a;
	cin >> a;
	if (a <= x)
	    vec.push_back(a);
	cur = (cur * (i + 1)) % mod;
    }
    sort(vec.begin(), vec.end());

    for (int i = 0; i <= n; i++)
	dpw[i] = pw(i, mod - 2);
    
    for (int i = 0; i <= x; i++) {
	int pos = upper_bound(vec.begin(), vec.end(), i) - vec.begin();
	if (pos == 0)
	    dp[i] = i;
	for (int j = 0; j < pos; j++) {
	    //cout << i << " " << vec[j] << " " << dp[i % vec[j]] << endl;
	    dp[i] = (dp[i] + dpw[pos] * dp[i % vec[j]]) % mod;
	}
	
	//cout << i << " " << pos << " " << dp[i] << endl;
    }
    
    //cout << solve(x, n) << " " << cur  << endl;
    cout << 1ll * dp[x] * cur % mod << endl;
}

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <queue>
#include <stack>
#include <cstdlib>
#include <map>
#include <iomanip>
#include <set>
#include <stdio.h>
#include <ctype.h>
#include <random>
#include <string.h>
#include <cmath>
#include <unordered_map>
#include <cstdio>
using namespace std;
#define all(vec) vec.begin(),vec.end()
typedef long long ll;

ll gcd(ll x, ll y) {
	if (y == 0)return x;
	return gcd(y, x%y);
}
ll lcm(ll x, ll y) {
	return x / gcd(x, y)*y;
}
ll kai(ll x, ll y, ll m) {
	ll res = 1;
	for (ll i = x - y + 1; i <= x; i++) {
		res *= i; res %= m;
	}
	return res;
}
ll mod_pow(ll x, ll y, ll m) {
	ll res = 1;
	while (y > 0) {
		if (y & 1) {
			res = res * x % m;
		}
		x = x * x % m;
		y >>= 1;
	}
	return res;
}

ll comb(ll x, ll y, ll m) {
	if (y > x)return 0;
	return kai(x, y, m) * mod_pow(kai(y, y, m), m - 2, m) % m;
}

const ll mod = 1000000007;

int n, x;
vector<int> vec[1050000];
ll d[500010];
ll ans;

signed main() {
	cin >> n;
	for (int i = 1; i <= n; i++) {
		int a; cin >> a;
		x ^= a;
		vec[x].push_back(i);
	}
	if (x) {
		ll cnt1 = 0, cnt2 = 1;
		for (int j = 0; j < (int)vec[x].size(); j++) {
			int p = 0;
			if (j)p = vec[x][j - 1];
			int t = lower_bound(all(vec[0]), vec[x][j]) - lower_bound(all(vec[0]), p);
			cnt2 = (cnt2 + cnt1 * t) % mod;
			cnt1 = (cnt1 + cnt2) % mod;
		}
		cout << cnt2 << endl;
		return 0;
	}
	for (int i = 1; i < (1 << 20); i++) {
		if ((int)vec[i].size() == 0)continue;
		ll cnt1 = 0, cnt2 = 1;
		for (int j = 0; j < (int)vec[i].size(); j++) {
			int p = 0;
			if (j)p = vec[i][j - 1];
			int t = lower_bound(all(vec[0]), vec[i][j]) - lower_bound(all(vec[0]), p);
			cnt2 = (cnt2 + cnt1 * t) % mod;
			cnt1 = (cnt1 + cnt2) % mod;
		}
		ans = (ans + cnt1) % mod;
	}
	ll cnt = 1;
	for (int i = 1; i < (int)vec[0].size(); i++)cnt = cnt * 2 % mod;
	cout << (ans + cnt) % mod << endl;
}
