#include <bits/stdc++.h>
static int memo[100000 + 1] = {};
int calc(int n) {
  int n1, n2;
  if (n == 0) {
    return 0;
  } 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];
    }
  }
  i = 1;
  j = 0;
  b = 0;
  if (1 == broken[0]) {
    b = 1;
    j++;
  }
  i++;
  for (; i <= n; i++) {
    if (i == broken[j] && j == 0) {
      stages = i - b - 1;
      if (j < m) {
        b = broken[j];
        j++;
      }
      countp = calc(stages) % 1000000007;
      count = count * countp;
      count = count % 1000000007;
    } else if (i == broken[j]) {
      stages = i - b - 2;
      if (j < m) {
        b = broken[j];
        j++;
      }
      countp = calc(stages) % 1000000007;
      count = count * countp;
      count = count % 1000000007;
    } else if (i == n) {
      stages = i - b - 1;
      if (j < m) {
        b = broken[j];
        j++;
      }
      countp = calc(stages) % 1000000007;
      count = count * countp;
      count = count % 1000000007;
    }
  }
  printf("%lld", count);
  return 0;
}
