#include <bits/stdc++.h>
using namespace std;
int main(void) {
  long long i, j, n, m, a[100001], ans = 1;
  long long f[100000];
  f[0] = 1;
  f[1] = 1;
  for (i = 2; i < 100000; i++) {
    f[i] = f[i - 1] + f[i - 2];
    f[i] %= 1000000007;
  }
  cin >> n >> m;
  a[0] = -1;
  a[m + 1] = n + 1;
  for (i = 1; i < m + 1; i++) {
    cin >> a[i];
    if (a[i] - a[i - 1] == 1) {
      cout << 0 << endl;
      return 0;
    }
  }
  for (i = 0; i < m + 1; i++) {
    ans *= f[(a[i + 1] - a[i] - 2)];
    ans %= 1000000007;
  }
  cout << ans << endl;
  return 0;
}
