#include <bits/stdc++.h>
using namespace std;
const long long int LINF = 2000000000000000000ll;
const int INF = 1000000100;
const long long int MOD = 1e9 + 7;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(n, true);
  for (int i = 0; i < (m); ++i) {
    int b;
    cin >> b;
    a[b] = false;
  }
  vector<long long int> dp(n + 1);
  dp[0] = 1LL;
  if (a[1])
    dp[1] = 1LL;
  else
    dp[1] = 0LL;
  for (int i = 2; i < (n + 1); ++i) {
    if (a[i])
      dp[i] = dp[i - 1] + dp[i - 2];
    else
      dp[i] = 0LL;
    dp[i] = dp[i] % MOD;
  }
  long long int ans = dp[n];
  cout << ans << endl;
  return 0;
}
