#include <bits/stdc++.h>
using namespace std;
int n, m;
long long memo[100001];
int main() {
  memo[0] = 0;
  memo[1] = 1;
  memo[2] = 2;
  for (int i = 3; i < 100001; i++) {
    memo[i] = memo[i - 1] + memo[i - 2];
  }
  cin >> n >> m;
  vector<int> a(m);
  cin >> a[0];
  int prev = a[0];
  for (int i = 1; i < m; i++) {
    cin >> a[i];
    if (a[i] - prev == 1) {
      cout << 0 << endl;
      return 0;
    }
    prev = a[i];
  }
  int start = 0, end = 0;
  long long ans = 1;
  for (int i = 0; i < m; i++) {
    end = a[i] - 1;
    long long res = memo[end - start];
    if (res != 0) {
      ans *= res;
      ans = ans % 1000000007;
    }
    start = a[i] + 1;
  }
  long long res = memo[n - start];
  if (res != 0) {
    ans *= res;
    ans = ans % 1000000007;
  }
  cout << ans % 1000000007 << endl;
  return 0;
}
