#include <bits/stdc++.h>
using namespace std;
unsigned long fib(int x) {
  int a = 1;
  int b = 1;
  int c = 0;
  for (int i = 1; i < x; i++) {
    c = b;
    b = a + b;
    a = c;
  }
  return b;
}
int main() {
  unsigned long MOD = 1000000007;
  int N, M;
  cin >> N >> M;
  vector<int> a(M);
  for (int i = 0; i < M; i++) {
    cin >> a[i];
  }
  unsigned long ans = fib(a[0] - 1) % MOD;
  bool check = true;
  for (int i = 0; i < M - 1; i++) {
    if (a[i] + 1 == a[i + 1]) {
      cout << 0;
      check = false;
      break;
    }
    cout << (fib(a[i + 1] - a[i] - 1));
    ans = ((ans % MOD) * (fib(a[i + 1] - a[i] - 2) % MOD)) % MOD;
  }
  if (check) {
    cout << fib(N - a[M - 1] - 1);
    cout << ((ans % MOD) * (fib(N - a[M - 1] - 1) % MOD)) % MOD;
  }
}
