#include <bits/stdc++.h>
using namespace std;
long long ans = 0;
int n, m;
map<int, int> mp;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> m;
  vector<int> v(m + 1);
  v[0] = 0;
  for (int i = 1; i <= m; ++i) {
    cin >> v[i];
    mp[v[i]] = 1;
    if (i > 1 && v[i] - v[i - 1] == 1) {
      cout << 0;
      return 0;
    }
  }
  vector<vector<int>> adj(n + 1);
  for (int i = 0; i < n; ++i) {
    adj[i].emplace_back(i + 1);
    if (!(i & 1) && i < n - 1) {
      adj[i].emplace_back(i + 2);
    }
    if ((i & 1) && i < n - 1) {
      adj[i].emplace_back(i + 2);
    }
  }
  queue<int> qe;
  qe.push(0);
  bool vis[12345] = {false};
  vis[0] = true;
  while (!qe.empty()) {
    int u = qe.front();
    qe.pop();
    if (mp[u]) {
      continue;
    }
    if (u == n) {
      ++ans;
    }
    for (auto v : adj[u]) {
      qe.push(v);
    }
  }
  cout << ans % 1000000007;
  return 0;
}
