#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a[100000 + 5];
  int n, i, m, x1, x2, flag = 1, s[100000 + 5];
  a[1] = 1, a[2] = 1;
  a[0] = 1;
  for (i = 3; i < 100005; i++) {
    a[i] = a[i - 1] + a[i - 2];
    a[i] %= 1000000007;
  }
  scanf("%d %d", &n, &m);
  for (i = 0; i < m; i++) {
    scanf("%d", &s[i]);
    if (i != 0 && s[i] - s[i - 1] == 1) {
      flag = 0;
      break;
    }
  }
  if (flag == 0)
    printf("0\n");
  else {
    long long int ans = 0;
    for (i = 0; i < m; i++) {
      if (i == 0)
        ans += a[s[0] - 0];
      else {
        ans *= a[s[i] - 1 - s[i - 1]];
        ans %= 1000000007;
      }
    }
    ans *= a[n - s[i - 1]];
    ans %= 1000000007;
    printf("%lld\n", ans);
  }
  return 0;
}
