#include <bits/stdc++.h>
using namespace std;
template <class T>
void dumplist(T list) {
  for (auto item : list) {
    cout << item << " ";
  }
  cout << endl;
}
void solve() {
  long long N, M;
  cin >> N >> M;
  long long fib[100011];
  fib[0] = 1;
  fib[1] = 1;
  for (long long i = (2); i < (100010); i++) {
    fib[i] = fib[i - 1] + fib[i - 2];
  }
  long long ans = 1;
  long long pre = -1;
  long long a;
  for (long long i = 0; i < (M); i++) {
    cin >> a;
    if (pre == a) continue;
    if (pre + 1 == a) {
      cout << 0 << endl;
      return;
    }
    long long b = fib[(a - 1) - (pre + 1)];
    ans *= (b % 1000000007);
    ans %= 1000000007;
    pre = a;
  }
  a = N + 1;
  if (pre + 1 == a) {
    cout << 0 << endl;
    return;
  }
  long long b = fib[(a - 1) - (pre + 1)];
  ans *= (b % 1000000007);
  ans %= 1000000007;
  cout << ans << endl;
}
int main() {
  do {
    solve();
  } while (0);
}
