#include <bits/stdc++.h>
using namespace std;
int cache[100010] = {0};
long long fibo(int n) {
  if (n == 1 || n == 2) return 1;
  if (cache[n]) return cache[n];
  cache[n] = (fibo(n - 1) % 1000000007 + fibo(n - 2) % 1000000007) % 1000000007;
  return cache[n];
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  int a[m + 1];
  if (m != 0) cin >> a[1];
  for (int i = 2; i <= m; i++) {
    int x;
    cin >> x;
    if ((x - a[i - 1]) == 1) {
      cout << 0 << endl;
      return 0;
    }
    a[i] = x;
  }
  int prefix[m + 2];
  prefix[1] = a[1] - 1;
  for (int i = 2; i <= m; i++) {
    prefix[i] = a[i] - a[i - 1] - 2;
  }
  prefix[m + 1] = n - a[m] - 1;
  long long count = fibo(prefix[1] + 1) % 1000000007;
  for (int i = 2; i <= m + 1; i++) {
    count = ((count % 1000000007) * (fibo(prefix[i] + 1) % 1000000007)) %
            1000000007;
  }
  cout << count << endl;
  return 0;
}
