#include <bits/stdc++.h>
using namespace std;
const int INF = 1001001001;
const long long int LINF = 1001002003004005006ll;
const int mod = 1000000007;
void P(int x) { cout << x << endl; }
void P(long x) { cout << x << endl; }
void P(double x) { cout << x << endl; }
void P(long long int x) { cout << x << endl; }
void P(string x) { cout << x << endl; }
void P(char x) { cout << x << endl; }
long long int gcd(long long int a, long long int b) {
  return b ? gcd(b, a % b) : a;
}
long long int lcm(long long int a, long long int b) {
  return a / gcd(a, b) * b;
}
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(m);
  set<int> se;
  for (int i = 0; i < (int)(m); i++) {
    int tmp;
    cin >> tmp;
    se.insert(tmp);
  }
  long long int ans = 0;
  long long int dp[n + 11];
  for (int i = 0; i < (int)(n + 11); i++) {
    dp[i] = 0;
  }
  dp[0] = 1;
  auto itr = se.find(1);
  if (itr == se.end()) dp[1] = 1;
  for (int i = 2; i < n + 1; i++) {
    itr = se.find(i);
    if (itr == se.end()) dp[i] = dp[i - 1] + dp[i - 2];
  }
  P(dp[n] % mod);
  return 0;
}
