#include <bits/stdc++.h>
using namespace std;
int N, M;
int a[100000];
long long func[100001];
long long f(int k) {
  if (k == 0)
    return 1;
  else if ((k == 1) && (func[1] == 0))
    return 0;
  else if ((k == 1) && (func[1] == -1))
    return 1;
  else
    return func[k - 1] + func[k - 2];
}
int main() {
  cin >> N >> M;
  for (int i = 0; i < M; i++) cin >> a[i];
  for (int i = 0; i < N + 1; i++) func[i] = -1;
  for (int i = 0; i < M; i++) func[a[i]] = 0;
  for (int i = 0; i < N + 1; i++) {
    if (func[i] == -1) func[i] = f(i);
  }
  cout << func[N] % 1000000007 << endl;
  return 0;
}
