#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
long long dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
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;
}
long long fib(long long n) {
  vector<long long> a(n + 1);
  a[0] = 1;
  a[1] = 1;
  for (int i = (2); i < (n + 1); i++) {
    a[i] = a[i - 1] + a[i - 2];
    a[i] %= (long long)(1e9 + 7);
    ;
  }
  return a[n - 1];
}
int main() {
  long long n, m;
  cin >> n >> m;
  vector<long long> a(m), dp(n + 1);
  for (int i = 0; i < m; i++) cin >> a[i];
  dp[0] = 1;
  dp[1] = ((a[0] == 1) ? 0 : 1);
  long long now = ((a[0] == 1) ? 1 : 0);
  for (int i = (2); i < (n + 1); i++) {
    if (i == a[now]) {
      dp[i] = 0;
      now++;
    } else
      dp[i] = dp[i - 1] + dp[i - 2];
    dp[i] %= (long long)(1e9 + 7);
    ;
  }
  cout << dp[n] << endl;
  return 0;
}
