#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int MOD = 1000000007;
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> dp(M);
  int prev = -1;
  for (int i = 0; i < M; i++) {
    int a;
    cin >> a;
    if (prev == a) {
      cout << "0" << endl;
      return 0;
    }
    dp[a++] = -1;
    prev = a;
  }
  if (dp[1] == 0 && dp[2] == 0) {
    dp[1] = 1;
    dp[2] = 2;
  }
  if (dp[1] == -1 && dp[2] == 0) {
    dp[1] = -1;
    dp[2] = 1;
  }
  if (dp[1] == 0 && dp[2] == -1) {
    dp[1] = 1;
    dp[2] = -1;
  }
  for (int i = 3; i <= N; i++) {
    if (dp[i] == -1) {
      continue;
    } else if (dp[i - 1] == -1) {
      dp[i] = dp[i - 2] % MOD;
    } else if (dp[i - 2] == -1) {
      dp[i] = dp[i - 1] % MOD;
    } else {
      dp[i] = (dp[i - 1] + dp[i - 2]) % MOD;
    }
  }
  cout << dp[N] << endl;
}
