#include <bits/stdc++.h>
using namespace std;
int64_t fib(int64_t n) {
  if (n == 1 || n == 2) {
    return 1;
  } else {
    return (fib(n - 1) % 1000000007 + fib(n - 2) % 1000000007) % 1000000007;
  }
}
int main() {
  int64_t N, M;
  cin >> N >> M;
  vector<int64_t> A(M);
  for (int64_t i = 0; i < M; i++) {
    cin >> A.at(i);
  }
  if (M == 0) {
    cout << fib(N + 1) % 1000000007 << endl;
    goto finish;
  } else {
    int64_t Ans = fib(A.at(0));
    for (int64_t i = 1LL; i < M; i++) {
      if (A.at(i) - A.at(i - 1) == 1) {
        Ans = 0;
        break;
      } else {
        Ans *= fib(A.at(i) - A.at(i - 1LL) - 1LL) % 1000000007;
        Ans %= 1000000007;
      }
    }
    Ans *= fib(N - A.at(M - 1));
    Ans %= 1000000007;
    cout << Ans << endl;
  }
finish:
  N = 0;
}
