#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long lcm(long long a, long long b) { return a * b / gcd(a, b); }
unsigned long long fibonacci(unsigned long long n) {
  unsigned long long bb = 1, b = 1;
  if (n == 0) {
    return 0;
  } else if (n == 1) {
    return bb;
  } else if (n == 2) {
    return b;
  }
  unsigned long long f = bb + b;
  for (long long i = 0; i < (long long)(n - 2); i++) {
    f = bb + b;
    f %= 1000000007;
    bb = b;
    b = f;
  }
  return f;
}
int main() {
  unsigned long long n, m;
  cin >> n >> m;
  vector<unsigned long long> a(m + 1);
  for (long long i = 0; i < (long long)(m); i++) {
    unsigned long long b;
    cin >> b;
    a[i] = b;
  }
  a[m] = n + 1;
  vector<unsigned long long> p(m + 1);
  p[0] = fibonacci(a[0]);
  for (long long i = 1; i < (long long)m + 1; i++) {
    p[i] = fibonacci(a[i] - a[i - 1] - 1);
  }
  unsigned long long ans = 1;
  for (long long i = 0; i < (long long)(m + 1); i++) {
    ans *= p[i];
  }
  ans %= 1000000007;
  cout << ans << endl;
}
