#include <bits/stdc++.h>
int main(void) {
  long long int n, m;
  long long int a[100000];
  unsigned long long int ans = 0;
  unsigned long long int dp[100001];
  scanf("%lld %lld", &n, &m);
  for (long long int i = 0; i < m; i++) {
    scanf("%lld", &a[i]);
    if (i > 0 && a[i] - a[i - 1] == 1) {
      printf("0\n");
      return 0;
    }
    dp[a[i]] = -1;
  }
  if (dp[1] == -1) {
    dp[1] = 0;
    dp[2] = 1;
  } else if (dp[2] == -1) {
    dp[2] = 0;
  } else {
    dp[1] = 1;
    dp[2] = 2;
  }
  for (long long int i = 3; i <= n; i++) {
    if (dp[i] == -1) {
      dp[i] = 0;
      continue;
    }
    dp[i] = dp[i - 1] + dp[i - 2];
  }
  printf("%llu\n", dp[n] % 1000000007);
  return 0;
}
