#include <bits/stdc++.h>
using namespace std;
inline int_fast64_t read() {
  int_fast64_t x = 0, f = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
  return x * f;
}
inline string read_s() {
  string s = "";
  char c = getchar();
  while (c < '!' || c > '~') {
    c = getchar();
  }
  while (c >= '!' && c <= '~') {
    s += c;
    c = getchar();
  }
  return s;
}
int mod = 1e9 + 7;
int dp[100001];
int fib(int n) {
  if (n == 0) return 0;
  if (n == 1) return 1;
  if (dp[n] != 0) {
    return dp[n];
  }
  return dp[n] = (fib(n - 1) + fib(n - 2)) % mod;
}
void Main() {
  int N = read(), M = read();
  int_fast64_t ans = 1;
  vector<int> V(M + 1);
  V[0] = read();
  int temp, last = V[0];
  for (int i = 1; i < M; i++) {
    temp = read();
    V[i] = temp - last - 1;
    last = temp;
  }
  V[M] = N - last;
  for (auto v : V) {
    ans *= fib(v);
    ans %= mod;
  }
  printf("%lld\n", ans);
}
int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  Main();
  return 0;
}
