#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M, i, j;
  cin >> N >> M;
  int a, b, c, s[M + 1];
  j = 0;
  for (i = 0; i < M; i++) {
    cin >> a;
    if (i == 0) {
      s[i] = a - 1;
      b = a;
    } else {
      if (a - b == 1) {
        j = 1;
        break;
      } else {
        s[i] = a - b - 2;
        b = a;
      }
    }
  }
  unsigned long ans = 0;
  if (j != 1) {
    ans = 1;
    s[M] = N - b - 1;
    sort(s, s + M + 1);
    int f1, f2, f3;
    f1 = 0;
    f2 = 1;
    f3 = 0;
    int c = 0;
    for (i = 0; i < N; i++) {
      for (j = c; j < M + 1; j++) {
        if (i == s[j]) {
          ans *= f2;
          ans %= 1000000007;
          c++;
        } else
          break;
      }
      if (i == s[M] + 1) break;
      f3 = f1 + f2;
      f1 = f2;
      f2 = f3;
    }
  }
  cout << ans << endl;
}
