#include <bits/stdc++.h>
int main() {
  int n, m, i;
  long long pat = 1;
  scanf("%d%d", &n, &m);
  int a[m + 2];
  long long num[n + 2];
  a[0] = -1;
  for (i = 1; i <= m; i++) scanf("%d", &a[i]);
  a[m + 1] = n + 1;
  num[0] = 0;
  num[1] = 1;
  for (i = 2; i <= n + 1; i++) {
    num[i] = num[i - 1] + num[i - 2];
    num[i] % 1000000007;
  }
  for (i = 0; i <= m; i++) {
    pat *= num[a[i + 1] - a[i] - 1];
    pat %= 1000000007;
  }
  printf("%lld\n", pat);
  return 0;
}
