#include <bits/stdc++.h>
int main() {
  int n, m, a[100009], flag = 1;
  long long dp[100009], ans, mod = (long long)(1000000007);
  dp[0] = 1;
  dp[1] = 1;
  dp[2] = 2;
  scanf("%d%d", &n, &m);
  for (int i = 3; i <= 100000; i++) dp[i] = (dp[i - 1] + dp[i - 2]) % mod;
  for (int i = 1; i <= m; i++) scanf("%d", &a[i]);
  if (!m) {
    printf("%lld", dp[m]);
    return 0;
  }
  ans = dp[a[1] - 1];
  for (int i = 2; i <= m; i++) {
    ans = (ans * (dp[a[i] - a[i - 1] - 2])) % mod;
    if (a[i] - a[i - 1] < 2) {
      flag = 0;
      break;
    }
  }
  if (!flag) {
    printf("0");
    return 0;
  }
  ans = (ans * (dp[n - a[m] - 1])) % mod;
  printf("%lld", ans);
  return 0;
}
