#include <bits/stdc++.h>
using ll = unsigned long long;
using namespace std;
ll cnt = 0;
int n, m;
int* a;
int* s;
ll* dp;
void solve() {}
int main(void) {
  cin >> n >> m;
  a = new int[m];
  s = new int[n + 1];
  dp = new ll[n + 1];
  for (int i = 0; i < m; ++i) {
    cin >> a[i];
    s[a[i]] = -1;
  }
  dp[0] = 1;
  dp[1] = (s[1] != -1 ? 1 : 0);
  dp[2] = 2;
  for (int i = 2; i <= n; ++i) {
    if (s[i] != -1) {
      dp[i] = dp[i - 1] + dp[i - 2];
    } else {
      dp[i] = 0;
    }
  }
  cout << dp[n] % 1000000007 << endl;
  return 0;
}
