#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define ld long double
#define N (1<<18)
#define M 1000000007
using namespace std;
ll n, m, f;
ll aaa, bbb;
set<ll> kiel;
bool hae(ll kohta) {
kohta /= 2;
while(kohta>=1) {
if(kiel.find(kohta) != kiel.end())
return true;
kohta /=2;
}
return false;
}
void hmm(ll kohta) {
ll aa = kohta;
ll bb = kohta;
while(aa<(1<<(n-1)))
aa = aa*2;
while(bb<(1<<(n-1)))
bb = bb*2+1;
if((aa-((ll)1<<(n-1))) < ((ll)1<<n-1)/2) {
aaa+=bb-aa+1;
}else
bbb+=bb-aa+1;
aaa %= M;
bbb %= M;
}
int main() {
cin.tie(0);
cout.tie(0);
ios_base::sync_with_stdio(0);
cin >> n >> m;
if(1 == 1) { //////////////////////////////////////////
ll ans = 4;
for(int i=3; i<n; i++) {
ans *= 2;
ans%=M;
}
for(int i=0; i<m; i++) {
cin >> f;
kiel.insert(f);
}
vector<ll> ei;
for(auto u:kiel) {
if(hae(u))
ei.push_back(u);
}
for(auto u:ei)
kiel.erase(u);
for(auto u:kiel)
hmm(u);
aaa %= M;
bbb %= M;
aaa = (((ll)1<<(n-2))%M-aaa)%M;
bbb = (((ll)1<<(n-2))%M-bbb)%M;
cout << abs((aaa*bbb*2))%M;
exit(0);
}
if(n>6) {
if(m)
exit(0);
ll ans = 8;
for(int i=3; i<n; i++) {
ans *= 4;
ans%=M;
}
cout << ans;
exit(0);
}
for(int i=0; i<m; i++) {
cin >> f;
k[f] = 1;
}
d[1] = 1;
int a = 0;
int b = 0;
for(int i=2; i<(1<<n); i++) {
if(!k[i])
d[i] = d[i/2];
if(i>=(1<<(n-1))) {
if((i-(1<<(n-1))) < (1<<n-1)/2) {
a+=d[i];
}else
b+=d[i];
}
}
/* for(int i=(1<<(n-1))-1; i>=2; i--) {
d[i] = d[i*2]+d[i*2+1];
// if(k[i])
// d[i] = 0;
}*/
cout << a*b*2;
}