#include <bits/stdc++.h>
int fibo(int fib) {
  int f0 = 1, f1 = 1, f2, i;
  if (fib == 0) {
    return f0;
  } else if (fib == 1) {
    return f1;
  } else {
    for (i = 2; i <= fib; i++) {
      f2 = f1 + f0;
      f0 = f1;
      f1 = f2;
      f2 = f2 % 1000000007;
    }
    return f2;
  }
}
using namespace std;
int main(void) {
  int N, M, i, check = 0;
  unsigned long long int ans = 1;
  cin >> N >> M;
  int a[M];
  for (i = 0; i < M; i++) {
    cin >> a[i];
  }
  for (i = 0; i < M - 1; i++) {
    if (a[i + 1] - a[i] == 1) {
      cout << "0" << endl;
      check = 1;
      break;
    }
  }
  if (check == 0) {
    int dis[100000] = {};
    dis[0] = a[0] - 1;
    for (i = 1; i < M + 1; i++) {
      dis[i] = a[i] - a[i - 1] - 2;
    }
    dis[M] = N - a[M - 1] - 1;
    for (i = 0; i < M + 1; i++) {
      ans = (ans * fibo(dis[i])) % 1000000007;
    }
    if (M == 0) {
      ans = fibo(N);
    }
    cout << ans << endl;
  }
}
