#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int a[100000];
  unsigned long long fib[100000];
  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;
    }
  }
  fib[0] = 1;
  fib[1] = 1;
  for (int i = 2; i <= n; i++) {
    fib[i] = fib[i - 1] + fib[i - 2];
    fib[i] %= (1000000007);
    cout << i << " " << fib[i] << endl;
  }
  unsigned long long ans = 1;
  if (m == 0) {
    ans = fib[n];
  } else {
    ans = fib[a[0] - 1];
    for (int i = 1; i < m; i++) {
      ans *= fib[a[i] - a[i - 1] - 2];
      ans %= (1000000007);
    }
    ans *= fib[n - a[m - 1] - 1];
    ans %= (1000000007);
  }
  cout << ans << endl;
  return (0);
}
