#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
int main() {
  long long n, m, hoge;
  vector<long long> a;
  cin >> n >> m;
  vector<long long> dp(n + 1);
  dp[0] = 1;
  for (int i = 0; i < m; i++) {
    cin >> hoge;
    a.push_back(hoge);
    dp[hoge] = 0;
    if (i > 0 && a[i] - a[i - 1] <= 1) {
      cout << 0 << endl;
      return 0;
    }
  }
  for (int i = 1; i < n + 1; i++) {
    int j = 0;
    if (j < a.size() && i == a[j]) {
      j++;
      continue;
    }
    if (i >= 2) {
      dp[i] = (dp[i - 1] + dp[i - 2]) % mod;
    } else {
      dp[i] = dp[i - 1];
    }
  }
  cout << dp[n] << endl;
  return 0;
}
