#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  queue<int> q;
  long long dp[100010];
  for (int i = 0; i < (m); ++i) {
    int a;
    cin >> a;
    q.push(a);
  }
  dp[0] = 1;
  for (int i = 0; i <= n; ++i) {
    if (q.front() == i) {
      dp[i] = 0;
      q.pop();
    } else {
      if (i + 1 != q.front()) {
        dp[i + 1] = max(dp[i + 1], dp[i]);
        dp[i + 2] = max(dp[i + 2], dp[i] * 2);
      } else {
        dp[i + 2] = dp[i];
      }
    }
  }
  cout << dp[n] % 1000000007 << endl;
}
