#include<iostream> #include<cstdio> #define maxn 20 #define ll long long usingnamespacestd;
constint p = 1000000007; constint N = 20; constint M = (1 << N) - 1;
ll pow_mod(ll x, ll n){ ll s = 1; for (; n; n >>= 1) { if (n & 1) s = s * x % p; x = x * x % p; } return s; }
int n, m;
int a[1 << maxn];
int f[maxn]; intmain(){ ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
cin >> n; for (int i = 1; i <= n; ++i) { int x; cin >> x; ++a[x]; } for (int o = 0; o < N; ++o) for (int S = M; ~S; --S) if (!(S >> o & 1)) a[S] += a[S | 1 << o]; for (int S = 0; S <= M; ++S) { int s = 0; for (int o = 0; o < N; ++o) s += S >> o & 1; f[s] = (f[s] + pow_mod(2, a[S]) - 1) % p; } int ans = 0; for (int i = 0, t = 1; i < N; ++i, t = -t) ans = (ans + t * f[i]) % p; cout << (ans + p) % p << "\n"; return0; }