#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int a, long long int b) {
  return b ? gcd(b, a % b) : a;
}
long long int lcm(long long int a, long long int b) {
  return a / gcd(a, b) * b;
}
long long int func(long long int N) {
  if (N < 0)
    return 0;
  else if (N == 0)
    return 1;
  else if (N == 1)
    return 1;
  else if (N == 2)
    return 2;
  return func(N - 1) + func(N - 2);
}
signed main() {
  long long int N, M;
  cin >> N >> M;
  vector<long long int> a(N);
  for (long long int i = 0; i < (long long int)(M); i++) cin >> a[i];
  long long int ans = 1;
  long long int bottom = 0;
  long long int mod = 1e9 + 7;
  for (long long int i = 0; i < (long long int)(M + 1); i++) {
    long long int top = i != M ? (a[i] - 1) : N;
    ans *= (func(top - bottom)) % mod;
    ans %= mod;
    bottom = a[i] + 1;
  }
  cout << ans;
}
