#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 6;
const int mod = 1e9 + 7;
long long dp[maxn];
void init(long long x) {
  dp[1] = 1;
  dp[2] = 2;
  if (x >= 3) {
    for (int i = 3; i <= x; i++) {
      dp[i] = (dp[i - 1] + dp[i - 2]) % mod;
    }
  }
}
int main() {
  long long n, m;
  long long a[maxn];
  scanf("%lld%lld", &n, &m);
  memset(a, 0, sizeof(a));
  init(n);
  for (int i = 1; i <= m; i++) {
    scanf("%lld", &a[i]);
  }
  sort(a + 1, a + m + 1);
  long long ans;
  ans = 1;
  int flag = 0;
  if (a[m] == n) {
    flag = 1;
  }
  for (int j = 1; j <= m; j++) {
    if (j == 1) {
      if (a[j] == 1) {
        ans = 1;
      } else {
        ans = ans * dp[a[j] - 1] % mod;
      }
    } else {
      if (a[j] - a[j - 1] == 2) {
        ans = ans % maxn;
      } else {
        ans = ans * dp[a[j] - a[j - 1] - 2] % mod;
      }
    }
  }
  if (flag == 1) {
    printf("0\n");
  } else {
    printf("%lld\n", ans * dp[(n - a[m] - 1)] % mod);
  }
  return 0;
}
