#include <bits/stdc++.h>
using namespace std;
map<int, bool> flor;
int N;
long long int sum = 0;
void dfs(int num) {
  if (num == N) {
    sum++;
    return;
  }
  if (flor[num + 1] == false && num + 1 <= N) dfs(num + 1);
  if (flor[num + 2] == false && num + 2 <= N) dfs(num + 2);
  return;
}
int main() {
  int M;
  cin >> N >> M;
  int hold_N = N;
  int ans_sum = 0;
  for (int i = 0; i < M; i++) {
    int a;
    cin >> a;
    flor[a] = true;
  }
  for (int i = 1; i < N; i *= 2) {
    sum = 0;
    N = i;
    dfs(i);
    ans_sum += sum;
  }
  cout << sum % 1000000007 << endl;
}
