#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e16;
const long long mod = 1e9 + 7;
long long DPFibonacci(int x) {
  int dp[100000] = {0};
  dp[0] = 0;
  dp[1] = 1;
  for (int i = 2; i < x + 1; i++) {
    dp[i] = (dp[i - 1] + dp[i - 2]);
    dp[i] %= mod;
  }
  return dp[x];
}
int main() {
  long long n, m;
  cin >> n >> m;
  vector<long long> a(m + 1);
  for (int i = 0; i < (m + 1); i++) cin >> a[i];
  a[m] = n + 1;
  long long ans = 1;
  int pos = 0;
  for (long long i = 0; i < m + 1; i++) {
    cout << a[i] << ' ' << pos << endl;
    if (pos - a[i] == 0) {
      cout << 0 << endl;
      return 0;
    } else if (a[i] - pos == 1 || a[i] - pos == 2)
      ans = ans;
    else {
      int dif_a = a[i] - pos;
      ans = ans * DPFibonacci(dif_a);
      ans %= mod;
    }
    pos = a[i] + 1;
  }
  cout << ans << endl;
  return 0;
}
