#include <bits/stdc++.h>
using namespace std;
int a[100005];
long long ax[100005];
long long fibo[100005];
const long long md = 1000000007;
int n, m;
int main() {
  cin >> n >> m;
  for (int i = 0; i < m; i++) cin >> a[i];
  for (int i = 1; i < m; i++) {
    if (a[i] == (a[i - 1] + 1)) {
      cout << 0 << endl;
      return 0;
    }
  }
  fibo[0] = fibo[1] = 1;
  for (int i = 2; i < n; i++) fibo[i] = (fibo[i - 1] + fibo[i - 2]) % md;
  long long res = 1;
  long long stp = 0;
  for (int i = 0; i < m; i++) {
    if ((stp - 1) == a[i]) continue;
    res = res * (fibo[a[i] - stp - 1]);
    res = res % md;
    stp = a[i] + 1;
  }
  res = res * (fibo[n - stp]);
  res = res % md;
  cout << res << endl;
  return 0;
}
