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