#include <bits/stdc++.h>
using namespace std;
int N, M;
const long long mod = 1e9 + 7;
int dp[100001];
int main() {
  int a;
  cin >> N >> M;
  memset(dp, -1, sizeof(dp));
  for (int i = 0; i < M; i++) {
    cin >> a;
    dp[a] = 0;
  }
  dp[N] = 1;
  dp[N - 1] = 1;
  for (int i = N - 2; i >= 0; i--) {
    if (dp[i] > -1) continue;
    dp[i] = (dp[i + 1] + dp[i + 2]) % mod;
  }
  cout << dp[0] << endl;
  return 0;
}
