#include <bits/stdc++.h>
using namespace std;
const char wall = '#';
vector<vector<char>> fields;
vector<vector<bool>> used;
vector<vector<long long>> dist;
const int dx[4] = {0, -1, 0, 1};
const int dy[4] = {1, 0, -1, 0};
vector<long long> sum(10 * 100000 + 1, 0);
long long N, M;
vector<long long> A;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long lcm(long long a, long long b) { return b / gcd(a, b) * b; }
void fibo_memo(long long n) {
  if (n == 1 && !count(A.begin(), A.end(), n))
    sum[n] = 1;
  else if (n == 2 && !count(A.begin(), A.end(), n))
    sum[n] = sum[n] + 1;
  else {
    if (!count(A.begin(), A.end(), n)) sum[n] = sum[n - 1] + sum[n - 2];
  }
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> N >> M;
  A.resize(M);
  for (int i = 0; i < (M); i++) cin >> A[i];
  for (long long i = 1; i <= N; i++) {
    fibo_memo(i);
  }
  cout << sum[N] % 1000000007 << endl;
  return 0;
}
