#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  int a[100000];
  long long b;
  long long k;
  long long ans = 1;
  long long c1, c2;
  long long list[100000];
  list[0] = 1;
  list[1] = 1;
  for (int i = 0; i < N; i++) {
    list[i] = list[i - 1] + list[i - 2];
    list[i] = list[i] % 1000000007;
  }
  for (int i = 0; i < M; i++) {
    cin >> a[i];
    if (i == 0)
      k = a[i];
    else
      k = (a[i] - a[i - 1] - 1);
    if (k == 0) {
      cout << 0 << endl;
      return 0;
    }
    b = list[k - 1];
    ans = ans * b;
    ans = ans % 1000000007;
  }
  k = (N - a[M - 1]);
  if (k == 0) {
    cout << 0 << endl;
    return 0;
  }
  b = list[k - 1];
  ans = ans * b;
  ans = ans % 1000000007;
  cout << ans << endl;
  return 0;
}
