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