#include <bits/stdc++.h>
using namespace std;
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
long long N, M, now, A, ans = 1, mod = 1000000007, bef = -1;
long long fibo(long long sa) {
  if (sa < 2) {
    return 1;
  } else {
    return (fibo(sa - 1) + fibo(sa - 2)) % mod;
  }
}
bool flag = false;
int main() {
  cin >> N >> M;
  for (int i = 0; i < (int)(M); i++) {
    cin >> A;
    if (A - bef < 2) {
      flag = true;
      break;
    }
    bef = A;
    ans = (ans * fibo(A - 1 - now)) % mod;
    now = A + 1;
  }
  if (flag) {
    cout << 0 << endl;
    return 0;
  }
  ans = (ans * fibo(N - now)) % mod;
  cout << ans << endl;
}
