#include <bits/stdc++.h>
using namespace std;
int fib(int A, vector<int> V);
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> a(M);
  for (int i = 0; i < (M); i++) cin >> a[i];
  int seq = 0;
  for (int i = 0; i < (N); i++)
    if (binary_search((a).begin(), (a).end(), i + 1) &&
        binary_search((a).begin(), (a).end(), i + 2))
      seq += 1;
  if (seq > 0)
    cout << 0 << endl;
  else {
    cout << fib(N, a) % 1000000007 << endl;
  }
}
int fib(int A, vector<int> V) {
  long long ans;
  if (A == 0)
    ans = 1;
  else if (A == 1 && !binary_search((V).begin(), (V).end(), 1))
    ans = 1;
  else if (A == 1 && binary_search((V).begin(), (V).end(), 1))
    ans = 0;
  else if (binary_search((V).begin(), (V).end(), A - 1))
    ans = fib(A - 2, V);
  else if (binary_search((V).begin(), (V).end(), A - 2))
    ans = fib(A - 1, V);
  else
    ans = fib(A - 1, V) + fib(A - 2, V);
  return ans;
}
