#include <bits/stdc++.h>
using namespace std;
long long stairs[100005];
set<long long> s;
const long long mod = 1000000007;
int32_t main() {
  stairs[0] = 1;
  long long n, m;
  cin >> n >> m;
  for (long long i = 0; i < m; i++) {
    long long x;
    cin >> x;
    s.insert(x);
  }
  if (!(*s.lower_bound(1) == 1))
    stairs[1] = 1;
  else
    for (long long i = 2; i <= n; i++) {
      stairs[i] = (stairs[i - 1] + stairs[i - 2]) % mod;
      if (*s.lower_bound(i) == i) stairs[i] = 0;
    }
  cout << stairs[n] % mod;
  return 0;
}
