#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const long long mod = 998244353;
string S;
long long ans = 1, N, M, A[100005];
queue<int> que;
long long fib[100005];
int main() {
  cin >> N >> M;
  for (int i = 1; i < M + 1; i++) cin >> A[i];
  A[0] = -1;
  fib[1] = 1;
  fib[2] = 1;
  for (int i = 3; i < 100002; i++) {
    fib[i] = fib[i - 1] + fib[i - 2];
  }
  for (int i = 1; i < M + 1; i++) {
    if (A[i] - A[i - 1] == 1) {
      ans = 0;
      break;
    }
    ans = (ans * fib[A[i] - A[i - 1] - 1]) % MOD;
  }
  if (M > 0) {
    ans = (ans * fib[N - A[M]]) % MOD;
  }
  cout << ans << endl;
  return 0;
}
