#include <bits/stdc++.h>
const int mod = 1e9 + 7;
using namespace std;
int gcd(int a, int b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
long long int power(long long int x, long long int y, long long int m) {
  if (y == 0) return 1;
  long long int p = power(x, y / 2, m) % m;
  p = (p * p) % m;
  return (y % 2 == 0) ? p : (x * p) % m;
}
void solve() {
  int n, m;
  cin >> n >> m;
  vector<int> a(m, 0);
  for (long long int i = 0; i < m; i++) cin >> a[i];
  vector<long long int> fib(n + 1, 0);
  fib[2] = 1;
  fib[3] = 2;
  for (int i = 4; i < n + 1; i++) {
    fib[i] = fib[i - 1] + fib[i - 2];
    fib[i] %= mod;
  }
  long long int ans = 1;
  if (a[0] != 1) ans *= fib[a[0]];
  ans %= mod;
  for (long long int i = 1; i <= m - 1; i++) {
    ans *= fib[a[i] - a[i - 1] - 1];
    ans %= mod;
  }
  ans *= fib[n - a[m - 1]];
  ans %= mod;
  cout << ans;
  return;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int TC = 1, t = 0;
  while (t++ < TC) {
    solve();
  }
  cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC
       << "ms\n";
  return 0;
}
