#include <bits/stdc++.h>
int main(void) {
  long long int n, m;
  scanf("%lld %lld", &n, &m);
  long long int i, j, k;
  i = 0;
  j = 0;
  k = 0;
  long long int *a;
  a = (long long int *)malloc(sizeof(long long int) * (m));
  while (i < m) {
    scanf("%lld", &(a[i]));
    i++;
  }
  i = 0;
  long long int *dp;
  dp = (long long int *)malloc(sizeof(long long int) * (m + 2));
  dp[0] = 1;
  dp[1] = 1;
  j = 0;
  if (a[0] == 1) {
    dp[1] = 0;
    j++;
  }
  i = 2;
  while (i <= n) {
    dp[i] = (dp[i - 1] + dp[i - 2]) % 1000000007;
    if (a[j] == i) {
      dp[i] = 0;
      j++;
    }
    i++;
  }
  printf("%lld\n", dp[n]);
  return (0);
}
