#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); }
long long fibonacci(long long n) {
  if (n == 0) {
    return 0;
  } else if (n == 1) {
    return 1;
  } else {
    return fibonacci(n - 1) + fibonacci(n - 2);
  }
}
int main() {
  long long n, m;
  cin >> n >> m;
  vector<long long> a(m + 1);
  for (long long i = 0; i < (long long)(m); i++) {
    long long b;
    cin >> b;
    a[i] = b;
  }
  a[m] = n + 1;
  vector<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);
  }
  long long ans = 1;
  for (long long i = 0; i < (long long)(m + 1); i++) {
    ans *= p[i];
  }
  cout << (ans % 1000000007) << endl;
}
