#include <bits/stdc++.h>
using namespace std;
static const int MAX = 100001;
template <typename T>
T gcd(T a, T b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
template <typename T>
T lcm(T a, T b) {
  return a * b / gcd(a, b);
}
int main(int argc, const char *argv[]) {
  int n, m;
  int *a;
  long long *dp;
  a = new int[MAX];
  dp = new long long[MAX];
  cin >> n >> m;
  for (int i = 0; i < (m); ++i) cin >> a[i];
  a[m] = n;
  dp[0] = 1;
  dp[1] = 2;
  for (int i = 0; i < (n); ++i) {
    if (i == 0 || i == 1) continue;
    dp[i] = dp[i - 2] + dp[i - 1];
  }
  long long res = 0;
  if (a[0] == 1) {
    res = 1;
    a[0]++;
  } else
    res = dp[a[0] - 2];
  for (int i = 0; i < (m); ++i) {
    res *= dp[a[i + 1] - a[i] - 2];
  }
  cout << res % 1000000007 << endl;
  return 0;
}
