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