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