#include <bits/stdc++.h>
using namespace std;
long long fibonacci(int n) {
  if (n == -1) return 0;
  if (n == 0 || n == 1)
    return 1;
  else if (n < 5)
    return (2 * fibonacci(n - 2) + fibonacci(n - 3));
  else
    return (5 * fibonacci(n - 4) + 3 * fibonacci(n - 5));
}
int main() {
  int n, m;
  cin >> n >> m;
  int v1, v2;
  long long ans = 1;
  if (m == 0) {
    cout << fibonacci(n) << endl;
    return 0;
  } else {
    v2 = -1;
    for (int i = 1; i < m + 1; i++) {
      v1 = v2;
      cin >> v2;
      ans *= fibonacci(v2 - v1 - 2);
      ans %= 1000000007;
    }
    ans *= fibonacci(n + 1 - v2 - 2);
    ans %= 1000000007;
    cout << ans << endl;
    return 0;
  }
}
