#include <bits/stdc++.h>
using namespace std;
int dp__[100];
long long gcd(long long x, long long y) {
  if (x % y == 0) return y;
  return gcd(y, x % y);
}
long long lcm(long long x, long long y) { return x * y / gcd(x, y); }
int fib(int n) {
  if (n == 0 || n == 1) return dp__[n] = 1;
  if (dp__[n] != -1) return dp__[n];
  return dp__[n] = fib(n - 1) + fib(n - 2);
}
int fact(int n) {
  if (n = 1) return 1;
  return n * fact(n - 1);
}
long long expo(int x, int y) {
  long long ans = 1;
  for (int i = 0; i < (int)(y); i++) {
    ans *= x;
  }
  return ans;
}
int keta(long long x) {
  if (x == 0) return 1;
  int res = 0;
  while (x) {
    x /= 10;
    res++;
  }
  return res;
}
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> broken(n);
  for (int i = 0; i < (int)(m); i++) {
    int a;
    cin >> a;
    broken[a] = 1;
  }
  vector<long long> dp(n + 2);
  dp[n] = 1;
  for (long long i = n - 1; i >= 0; i--) {
    if (broken[i]) {
      dp[i] = 0;
      continue;
    }
    dp[i] = dp[i + 1] + dp[i + 2];
  }
  long long ans = dp[0] % 1000000007;
  cout << ans << endl;
}
