#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int x, long long int y) {
  while (y != 0) {
    if (x > y) {
      long long int r = x % y;
      x = y;
      y = r;
    } else {
      long long int r = y % x;
      y = r;
    }
  }
  return x;
}
int main(void) {
  long long int N, M;
  long long int ans = 1;
  cin >> N >> M;
  vector<long long int> a(M + 2), fib(N + 1);
  fib[0] = 0;
  fib[1] = 1;
  fib[2] = 2;
  for (int i = 3; i < N + 1; i++) {
    fib[i] = fib[i - 1] + fib[i - 2];
  }
  for (int i = 0; i < M + 2; i++) {
    cin >> a[i];
    if (i == M) a[i] = -1;
    if (i == M + 1) a[i] = N + 1;
  }
  sort(a.begin(), a.end());
  for (int i = 0; i < M + 1; i++) {
    if ((a[i + 1] - 1) - (a[i] + 1) < 0) {
      ans = 0;
      break;
    } else if ((a[i + 1] - 1) - (a[i] + 1) == 0)
      ans *= 1;
    else
      ans *= fib[(a[i + 1] - 1) - (a[i] + 1)];
  }
  cout << ans % 1000000007 << endl;
}
