#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long lcm(long long a, long long b) {
  long long g = gcd(a, b);
  return a / g * b;
}
int main() {
  long long n, m, cnt = 0;
  cin >> n >> m;
  vector<long long> dp(n + 1, 0), a(m);
  for (int(i) = 0; (i) < (m); ++(i)) cin >> a[i];
  dp[0] = 1;
  if (a[cnt] == 1) {
    dp[1] = 0;
    ++cnt;
  } else {
    dp[1] = 1;
  }
  for (int(i) = (2); (i) < (n + 1); ++(i)) {
    if (a[cnt] == i) {
      dp[i] = 0;
      ++cnt;
    } else {
      dp[i] = dp[i - 1] + dp[i - 2];
      dp[i] %= (1000000007);
    }
  }
  cout << dp[n] << endl;
  return 0;
}
