#include <bits/stdc++.h>
using namespace std;
long long func(int n, set<int>& a);
int main(void) {
  int N, M;
  cin >> N >> M;
  set<int> a;
  for (int(i) = 0; (i) < (M); (i)++) {
    int temp;
    cin >> temp;
    a.insert(temp);
  }
  cout << func(N, a) << endl;
  return 0;
}
vector<long long> cache(100000, -1);
long long func(int n, set<int>& a) {
  if (n == 0) {
    return 1;
  } else if (n < 0) {
    return 0;
  } else if (cache.at(n) != (-1)) {
    return cache.at(n);
  }
  long long ret = 0;
  if (a.count(n - 1) == 0) {
    ret += func(n - 1, a);
  }
  if (a.count(n - 2) == 0) {
    ret += func(n - 2, a);
  }
  ret = ret % 1000000007;
  cache.at(n) = ret;
  return ret;
}
