#include <bits/stdc++.h>
using namespace std;
long long fibonacci_recursive(int n) {
  if (n == 1) return 1;
  if (n == 2) return 1;
  if (n >= 3) return fibonacci_recursive(n - 1) + fibonacci_recursive(n - 2);
  return 0;
}
int main() {
  int N, M;
  int i;
  cin >> N >> M;
  long long sum = 1;
  vector<int> a(M);
  for (i = 0; i < M; i++) {
    cin >> a[i];
  }
  for (i = 0; i < M - 1; i++) {
    if (a[i + 1] - a[i] == 1) {
      sum = 0;
      cout << sum << endl;
      return 0;
    }
  }
  sum = fibonacci_recursive(a[0]);
  for (i = 1; i < M; i++) {
    sum *= fibonacci_recursive(a[i] - a[i - 1] - 1);
    sum %= (long long)1e9 + 7;
  }
  if (N != a[M - 1]) {
    sum *= fibonacci_recursive(N - a[M - 1]);
    sum %= (long long)1e9 + 7;
  }
  cout << sum << endl;
  return 0;
}
