#include <bits/stdc++.h>
using namespace std;
long long dp[101010];
long long MOD = 1000000007;
bool ban[101010];
int main() {
  int N, M;
  cin >> N >> M;
  long long ans;
  for (int i = 0; i < M; i++) {
    int x;
    cin >> x;
    ban[x] = true;
  }
  dp[0] = 1;
  for (int i = 1; i <= N; i++) {
    if (!ban[i]) (dp[i] = dp[i - 1] + dp[i - 2]) % MOD;
  }
  cout << dp[N] << endl;
}
