#include <bits/stdc++.h>
using namespace std;
long long fibo(long long x) {
  vector<long long> dp(100000000);
  dp[0] = 0;
  dp[1] = 1;
  for (long long i = 2; i <= x; i++) {
    dp[i] = dp[i - 1] + dp[i - 2];
  }
  return dp[x];
}
long long fibo1(long long x) {
  long long dp;
  dp = (long long)((pow((1 + sqrt(5)) / 2.0, x) - pow((1 - sqrt(5)) / 2.0, x)) /
                   sqrt(5));
  return dp;
}
int main() {
  long long n, m, i, j, tmp = -1, ans = 1;
  cin >> n >> m;
  vector<long long> a(m);
  for (i = 0; i < m; i++) {
    cin >> a[i];
  }
  for (i = 0; i < m; i++) {
    ans *= fibo1(a[i] - tmp - 1);
    ans %= (1000000007);
    tmp = a[i];
  }
  ans *= fibo1(n - tmp);
  ans %= (1000000007);
  cout << ans << endl;
}
