#include <bits/stdc++.h>
using namespace std;
long long memo[100010];
long long fib(long long x) {
  if (x == 0)
    return 0;
  else if (x == 1)
    return 1;
  else if (memo[x] != 0)
    return memo[x];
  memo[x] = (fib(x - 1) + fib(x - 2) % 1000000007);
  return memo[x];
}
int main() {
  for (long long &i : memo) i = 0;
  int N, M;
  cin >> N >> M;
  if (M != 0) {
    int a[M];
    cin >> a[0];
    int eve = a[0];
    bool dead = false;
    for (int i = 1; i < M; ++i) {
      cin >> a[i];
      if (a[i] - eve == 1) dead = true;
      eve = a[i];
    }
    if (dead) {
      cout << 0 << endl;
      return 0;
    }
    long long curPat = fib(a[0]);
    for (int i = 1; i < M; ++i) {
      curPat = curPat * fib(a[i] - a[i - 1] - 1) % 1000000007;
    }
    curPat *= fib(N - a[M - 1]);
    cout << (curPat % 1000000007) << endl;
  } else {
    cout << fib(N + 1) % 1000000007 << endl;
  }
}
