#include <bits/stdc++.h>
using namespace std;
map<int, unsigned long> memo;
unsigned long fib(int n) {
  if (n >= 2 && memo[n] > 0)
    return memo[n];
  else if (n >= 2)
    return memo[n] = fib(n - 1) + fib(n - 2);
  else
    return memo[n];
}
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(m);
  for (int i = 0; i < m; i++) cin >> a[i];
  memo[-1] = 0;
  memo[0] = 1;
  memo[1] = 1;
  unsigned long ans;
  if (m == 0) {
    ans = fib(n) % 1000000007;
  } else {
    ans = (fib(a[0] - 1) * fib(n - a[m - 1] - 1)) % 1000000007;
    for (int i = 1; i < m; i++) {
      int A = a[i] - a[i - 1];
      ans *= fib(A - 2);
      ans %= 1000000007;
    }
  }
  cout << ans << endl;
  return 0;
}
