#include <bits/stdc++.h>
int main() {
  long long int i, j = 1, n, m, fibo = 1, fi = 1, f = 0, a[100000], sum = 1;
  bool flag = true;
  scanf("%lld %lld", &n, &m);
  a[0] = -1;
  for (i = 1; i <= m; i++) {
    scanf("%lld", &a[i]);
  }
  for (i = 1; i <= m; i++) {
    if (a[i] - a[i - 1] == 1) {
      printf("0\n");
      return 0;
    }
  }
  for (i = 1; i <= n; i++) {
    flag = true;
    for (j = 1; j <= m; j++) {
      if (a[j] == i) {
        a[j] = 0;
        flag = false;
        sum *= fibo;
        fibo = 1;
        fi = 1;
        f = 0;
        i++;
        break;
      }
    }
    if (flag == true) {
      fibo = fi + f;
      f = fi;
      fi = fibo;
    }
  }
  sum *= fibo;
  printf("%lld\n", sum % 1000000007);
  return 0;
}
