#include <bits/stdc++.h>
using namespace std;
int main() {
  int64_t N, M;
  cin >> N >> M;
  int64_t answer = 1;
  vector<int> a(N), del(N);
  vector<int64_t> fib(N);
  for (int i = 0; i < 100005; i++) {
    if (i == 0 || i == 1)
      fib[i] = 1;
    else {
      fib[i] = fib[i - 1] + fib[i - 2];
      fib[i] = fib[i] % 1000000007;
    }
  }
  a[M + 1] = N + 1;
  a[0] = -1;
  for (int i = 1; i <= M + 1; i++) {
    if (i != M + 1) cin >> a[i];
    del[i] = a[i] - a[i - 1] - 2;
    if (del[i] < 0 && i != 0) {
      answer = 0;
      break;
    } else {
      answer *= fib[del[i]];
      answer = answer % 1000000007;
    }
  }
  cout << answer;
}
