#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  int M;
  cin >> M;
  vector<int> a(M);
  for (int i = 0; i < M; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < (M - 1); i++) {
    if (a[i] == (a[i + 1] - 1)) {
      cout << 0;
      return 0;
    }
  }
  vector<int> fib(N + 1);
  fib[0] = 1;
  fib[1] = 1;
  fib[2] = 2;
  fib[3] = 3;
  for (int i = 4; i <= N; i++) {
    fib[i] = fib[i - 1] + fib[i - 2];
  }
  int tmp = 0;
  long long int ans = 1;
  for (int i = 0; i < M; i++) {
    ans *= fib[(a[i] - tmp - 1)];
    tmp = a[i] + 1;
  }
  ans *= fib[(N - tmp)];
  cout << (ans % 1000000007);
  return 0;
}
