#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(n + 1);
  for (int i = 0; i < (m); ++i) {
    int s;
    ++s;
    cin >> s;
    a[s] = 1;
  }
  vector<long long> ans(n + 2);
  ans[n] = 1;
  int i = n;
  while (i >= 1) {
    if (a[i - 1] == 0 && a[i] == 1 && a[i + 1] == 0) {
      ans[i] = 0;
      ans[i - 1] = ans[i + 1];
    } else if (a[i - 1] == 0 && a[i] == 0 && a[i + 1] == 1) {
      ans[i] = ans[i + 2];
      ans[i - 1] = ans[i];
    } else if (a[i - 1] == 1 && a[i] == 0 && a[i + 1] == 0) {
      ans[i] = (ans[i + 2] + ans[i + 1]) % mod;
      ans[i - 1] = 0;
    } else if (a[i - 1] == 0 && a[i] == 0 && a[i + 1] == 0) {
      ans[i - 1] = (ans[i] + ans[i + 1]) % mod;
    } else if (a[i - 1] == 1 && a[i] == 0 && a[i + 1] == 1) {
      ans[i - 1] = 0;
      ans[i - 1] = a[i + 2];
      ans[i + 1] = 0;
    } else if (a[i - 1] == 1 && a[i] == 1 && a[i + 1] == 0) {
      cout << 0 << endl;
      return 0;
    } else if (a[i - 1] == 0 && a[i] == 1 && a[i + 1] == 1) {
      cout << 0 << endl;
      return 0;
    } else if (a[i - 1] == 1 && a[i] == 1 && a[i + 1] == 1) {
      cout << 0 << endl;
      return 0;
    }
    i--;
  }
  cout << ans[0] << endl;
  return 0;
}
