#include <bits/stdc++.h>
using namespace std;
int main(void) {
  cin.tie(0);
  cout.tie(0);
  ios::sync_with_stdio(false);
  long long N, M;
  cin >> N >> M;
  vector<long long> stair(N + 1, 0);
  for (long long i = 0; i < (long long)M; ++i) {
    long long tmp;
    cin >> tmp;
    stair[tmp] = 1;
  }
  long long dp[N + 1];
  for (long long i = 0; i < (long long)N + 1; ++i) dp[i] = 0;
  dp[0] = 1;
  dp[1] = 1;
  for (long long i = 1; i < N; ++i) {
    if (stair[i + 1] != 1) dp[i + 1] = dp[i - 1] + dp[i];
    dp[i + 1] %= 1000000007;
  }
  cout << dp[N] << endl;
}
