#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  vector<long long> dp(N + 10);
  vector<int> a(M);
  for (int i = (int)(0); i < (int)(M); i++) {
    cin >> a[i];
  }
  dp[0] = 1;
  dp[1] = 1;
  for (int i = (int)(0); i < (int)(N); i++) {
    if (*lower_bound(a.begin(), a.end(), i + 2) == i + 2)
      dp[i + 2] = 0;
    else
      dp[i + 2] = (dp[i + 1] + dp[i]) % 1000000007;
  }
  for (int i = (int)(0); i < (int)(M - 1); i++) {
    if (a[i + 1] == a[i] + 1) {
      cout << 0 << endl;
      return 0;
    }
  }
  cout << dp[N] << endl;
}
