#include <bits/stdc++.h>
using namespace std;
const long long INF = 1LL << 60;
const long long MOD = 1000000007;
int N;
int M;
long long dp[100010];
long long a[100010];
int main() {
  cin >> N >> M;
  for (int i = 0; i < M; i++) {
    cin >> a[i];
    if (i != 0 && a[i] == a[i + 1] - 1) {
      cout << 0 << endl;
      return 0;
    }
  }
  a[M] = INF;
  dp[0] = 1;
  for (int i = 1; i < N; i++) dp[i] = 0;
  int j = 0, k = 0;
  for (int i = 0; i < N; i++) {
    if (i + 1 != a[j])
      dp[i + 1] += dp[i];
    else
      j++;
    if (i + 2 != a[k])
      dp[i + 2] += dp[i];
    else
      k++;
  }
  cout << dp[N] % MOD << endl;
  return 0;
}
