#include <bits/stdc++.h>
using namespace std;
unsigned long long mod = 1000000007;
unsigned long long N;
unsigned long long M;
unsigned long long ans = 0;
int main() {
  cin >> N;
  cin >> M;
  unsigned long long des[M];
  unsigned long long dp[N + 2];
  for (unsigned long long i = 0; i < N; i++) {
    if (i < M) {
      cin >> des[i];
      if (des[i] - 1 == des[i - 1] and i and i < N - 1) {
        cout << 0 << endl;
        return 0;
      }
    }
    dp[i] = 0;
  }
  unsigned long long s = 0;
  dp[0] = 1;
  for (unsigned long long i = 0; i < N; i++) {
    if (i == des[s]) {
      dp[i] = 0;
      if (s < M - 1) s++;
      continue;
    }
    dp[i] %= mod;
    dp[i + 1] = (dp[i + 1] % mod + dp[i] % mod) % mod;
    dp[i + 2] = (dp[i + 2] % mod + dp[i] % mod) % mod;
  }
  cout << (dp[N - 1] % mod + dp[N - 2] % mod) % mod << endl;
}
