#include <bits/stdc++.h>
using namespace std;
int n, m;
vector<long long> a;
vector<long long> fib(100001);
int main() {
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    long long tmp;
    cin >> tmp;
    a.push_back(tmp);
  }
  fib[0] = 1;
  fib[1] = 1;
  for (int i = 2; i < 100001; i++) {
    fib[i] = (fib[i - 1] + fib[i - 2]) % 1000000007;
  }
  if (m == 0) {
    cout << fib[n] << endl;
    return 0;
  }
  for (int i = 1; i < a.size(); i++) {
    if (a[i] == a[i - 1] + 1) {
      cout << 0 << endl;
      return 0;
    }
  }
  int start = 0;
  int goal = a[0] - 1;
  long long ans = 1;
  for (int i = 0; i < a.size(); i++) {
    ans *= (fib[goal - start] % 1000000007);
    start = goal + 2;
    goal = a[i + 1];
  }
  goal = n;
  ans *= (fib[goal - start] % 1000000007);
  cout << ans % 1000000007 << endl;
}
