#include <bits/stdc++.h>
using namespace std;
long long fM(long long k) {
  int sum = 1;
  for (int i = 1; i <= k; ++i) {
    sum *= i;
  }
  return sum;
}
int main() {
  int N, M;
  cin >> N >> M;
  int a[100000];
  long long b;
  int k;
  long long ans = 1;
  int c1, c2;
  for (int i = 0; i < M; i++) {
    cin >> a[i];
    if (i == 0)
      k = a[i];
    else
      k = (a[i] - a[i - 1] - 1);
    if (k == 0) {
      cout << 0 << endl;
      return 0;
    }
    if (k == 1 || k == 2) {
      b = 1;
    } else {
      c1 = 1;
      c2 = 1;
      for (int i = 0; i < k - 2; i++) {
        b = c1 + c2;
        c2 = c1;
        c1 = b;
      }
    }
    ans = ans * b;
  }
  k = (N - a[M - 1]);
  if (k == 0) {
    cout << 0 << endl;
    return 0;
  }
  if (k == 1 || k == 2) {
    b = 1;
  } else {
    c1 = 1;
    c2 = 1;
    for (int i = 0; i < k - 2; i++) {
      b = c1 + c2;
      c2 = c1;
      c1 = b;
    }
  }
  ans = ans * b;
  while (ans > 1000000006) {
    ans = ans - 1000000007;
  }
  cout << ans << endl;
  return 0;
}
