#include <bits/stdc++.h>
static int memo[100000 + 1] = {};
int calc(int n) {
  int n1, n2;
  if (n == 0) {
    return 1;
  } else if (n == 1) {
    memo[1] = 1;
    return 1;
  } else if (n == 2) {
    memo[2] = 2;
    return 2;
  } else {
    if (memo[n - 2] == 0) {
      n2 = calc(n - 2);
      memo[n - 2] = n2;
    } else {
      n2 = memo[n - 2];
    }
    if (memo[n - 1] == 0) {
      n1 = calc(n - 1);
      memo[n - 1] = n1;
    } else {
      n1 = memo[n - 1];
    }
    if (memo[n] == 0) {
      memo[n] = n2 + n1;
    }
    return n2 + n1;
  }
}
int main(void) {
  int n, m;
  int broken[100000] = {};
  int i, j, k, b;
  int stages;
  long long int count = 1, countp;
  scanf("%d %d", &n, &m);
  for (i = 0; i < m; i++) {
    scanf("%d", &broken[i]);
  }
  k = broken[0];
  for (i = 1; i < m; i++) {
    if (broken[i] - k == 1) {
      count = 0;
    } else {
      k = broken[i];
    }
  }
  if (count) {
    if (m == 0) {
      count = calc(n) % 1000000007;
    } else if (m == 1) {
      count = calc(broken[0] - 1) % 1000000007;
      count = count * (calc(n - broken[0] - 1) % 1000000007);
    } else {
      count = calc(broken[0] - 1) & 1000000007;
      for (i = 1; i < m; i++) {
        k = (broken[i] - broken[i - 1] - 2) > 0 ? broken[i] - broken[i - 1] - 2
                                                : 1;
        count = count * (calc(k) % 1000000007);
        count = count % 1000000007;
      }
      count = count * (calc(n - broken[m - 1] - 1) % 1000000007);
    }
  }
  count = count % 1000000007;
  printf("%lld", count);
  return 0;
}
