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