#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int mod = 1e9 + 7;
set<int> a;
int dp[100005];
int f(int i) {
  if (i < 0) return 0;
  if (dp[i] != 0) return dp[i];
  if (a.find(i) != a.end()) return 0;
  return dp[i] = (f(i - 1) + f(i - 2)) % mod;
}
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < (int)(m); ++i) {
    int x;
    cin >> x;
    a.insert(x);
  }
  dp[0] = 1;
  f(n);
  cout << dp[n] << endl;
  return 0;
}
