#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int INF = 1e18 + 9;
constexpr long double pi = 3.141592653589793238462643383279;
int fact(int i) {
  if (i == 0) return 1;
  return (fact(i - 1)) * i;
}
int gcd(int a, int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int lcm(int a, int b) { return a * b / gcd(a, b); }
int keta(int n) {
  if (n == 0) return 1;
  int count = 0;
  while (n != 0) {
    n /= 10;
    count++;
  }
  return count;
}
int ketasum(int n) {
  int sum = 0;
  while (n != 0) {
    sum += n % 10;
    n /= 10;
  }
  return sum;
}
int main() {
  int n, m;
  cin >> n >> m;
  vector<long long> k(n + 1, true);
  for (int i = 0; i < n; ++i) {
    int a;
    cin >> a;
    k[a] = false;
  }
  vector<long long> dp(n + 1);
  dp[0] = 0;
  for (int i = 0; i < n; ++i) {
    for (int j = i + 1; j <= min(n, i + 2); ++j) {
      if (k[j]) {
        dp[j] += dp[i];
        dp[i] %= MOD;
      }
    }
  }
  cout << dp[n] << "\n";
  return 0;
}
