#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
const int mod2 = 998244353;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(m);
  vector<int> dp(n + 1);
  for (int i = 0; i < (m); ++i) cin >> a[i];
  int j = 0;
  dp[0] = 1;
  if (a[0] == 1)
    j++;
  else
    dp[1] = 1;
  for (int i = (2); i < (n + 1); ++i) {
    if (i == a[j]) {
      j++;
      continue;
    }
    dp[i] = (dp[i - 1] + dp[i - 2]) % mod;
  }
  cout << dp[n] << endl;
}
