#include <bits/stdc++.h>
using namespace std;
long long fib_memo[100005] = {0};
long long fib(long n) {
  if (n == 0) {
    return 1;
  }
  if (n == 1) {
    return 1;
  }
  if (fib_memo[n] != 0) {
    return fib_memo[n];
  }
  return fib_memo[n] = (fib(n - 1) + fib(n - 2)) % 1000000007;
}
int main() {
  long n, m;
  cin >> n >> m;
  long A[100005];
  for (long i = 0; i < m; i++) {
    cin >> A[i];
  }
  for (long i = 1; i < m; i++) {
    if (A[i] == A[i - 1] + 1) {
      cout << 0 << endl;
    }
  }
  long long ans = 0;
  for (long i = 0; i <= m; i++) {
    if (i == 0) {
      ans = fib(A[0] - 1);
    } else if (i == m) {
      ans *= (fib(n - A[m - 1] - 1) % 1000000007);
    } else {
      ans *= (fib(A[i] - A[i - 1] - 2) % 1000000007);
    }
    ans %= 1000000007;
  }
  cout << ans << endl;
}
