#include <bits/stdc++.h>
using namespace std;
long long memo[100005];
long long N, M;
long fib(int n) {
  if (n <= 1) return n;
  if (memo[n] != 0) return (memo[n]) % 1000000007;
  return memo[n] = (fib(n - 1) + fib(n - 2)) % 1000000007;
}
int main() {
  cin >> N >> M;
  long long cont = 1;
  int a = 0;
  int b = 0;
  for (int i = 0; i < M; ++i) {
    cin >> a;
    if (a == b + 1 && a != 1) {
      cout << 0 << endl;
      return 0;
    }
    cont = (cont * (fib(a - b))) % 1000000007;
    b = a;
  }
  cont = (cont * fib(N - b)) % 1000000007;
  cout << cont << endl;
}
