#include <bits/stdc++.h>
using namespace std;
set<long long> brokens;
long long sum(long long a, long long b) {
  return ((a % 1000000007) + (b % 1000000007)) % 1000000007;
}
long long multi(long long a, long long b) {
  return ((a % 1000000007) * (b % 1000000007)) % 1000000007;
}
long long solve(long long DP[], long long n) {
  if (brokens.count(n)) return 0;
  if (n < 0) return 0;
  if (n == 0) return 1;
  if (DP[n] != 0) return DP[n];
  return DP[n] = sum(solve(DP, n - 1), solve(DP, n - 2));
}
int main() {
  ios_base::sync_with_stdio(false);
  long long n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    long long b;
    cin >> b;
    brokens.insert(b);
  }
  long long DP[n + 1];
  memset(DP, 0, sizeof(DP));
  cout << solve(DP, n) << endl;
}
