#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
long long fib(long long step) {
  long long a = 1, b = 1, temp;
  if (step == 0) return 0;
  if (step == 1 || step == 2)
    return 1;
  else {
    for (long long i = 3; i <= step; i++) {
      temp = a + b;
      temp %= MOD;
      a = b;
      b = temp;
    }
    b %= MOD;
    return b;
  }
}
int main() {
  long long N, M, n = 0, count = 1;
  cin >> N >> M;
  long long a[M];
  for (long long i = 0; i < M; i++) {
    cin >> a[i];
  }
  long long m = 0;
  long long tcnt = 0;
  if (M > 0) {
    while (n != N) {
      if (n != a[m]) {
        tcnt++;
      } else {
        count *= fib(tcnt);
        count %= MOD;
        tcnt = 0;
        if (m < M - 1) m++;
      }
      n++;
    }
    count *= fib(++tcnt);
    count %= MOD;
  } else {
    count = fib(N);
    count %= MOD;
  }
  cout << count << endl;
  return 0;
}
