#include <bits/stdc++.h>
using namespace std;
const long long inf = 1000000007;
long long bin(long long bina) {
  long long ans = 0;
  for (long long i = 0; bina > 0; i++) {
    ans = ans + (bina % 2) * pow(10, i);
    bina = bina / 2;
  }
  return ans;
}
bool prime(long long n) {
  for (long long i = 2; i <= sqrt(n); i++) {
    if (n % i == 0) return false;
  }
  return n != 1;
}
long long gcd(long long x, long long y) {
  if (y == 0) return x;
  return gcd(y, x % y);
}
long long lcm(long long x, long long y) { return x * y / gcd(x, y); }
long long kai(long long x) {
  if (x == 0) return 1;
  return kai(x - 1) * x % inf;
}
long long mod_pow(long long x, long long y, long long mod) {
  long long res = 1;
  while (y > 0) {
    if (y & 1) {
      res = res * x % mod;
    }
    x = x * x % mod;
    y >>= 1;
  }
  return res;
}
long long comb(long long x, long long y) {
  return kai(x) * mod_pow(kai(x - y), inf - 2, inf) % inf *
         mod_pow(kai(y), inf - 2, inf) % inf;
}
struct union_find {
  long long par[200010], size_[200010];
  void init(long long x) {
    for (long long i = 0; i < x; ++i) {
      par[i] = i;
      size_[i] = 1;
    }
  }
  long long find(long long x) {
    if (par[x] == x) return x;
    return par[x] = find(par[x]);
  }
  void unite(long long x, long long y) {
    x = find(x);
    y = find(y);
    if (x == y) return;
    if (size_[x] < size_[y]) {
      par[x] = y;
      size_[y] += size_[x];
    } else {
      par[y] = x;
      size_[x] += size_[y];
    }
  }
};
long long a[100010];
long long b[100010];
signed main() {
  a[0] = 1;
  a[1] = 2;
  for (long long i = 2; i < 100001; ++i) {
    a[i] = a[i - 1] + a[i - 2];
    a[i] %= inf;
  }
  long long n, m, ans;
  cin >> n >> m;
  if (m == 0) {
    cout << a[n - 1] << endl;
    return 0;
  }
  for (long long i = 0; i < m; ++i) {
    cin >> b[i];
  }
  if (b[0] == 1) {
    ans = 1;
  } else {
    ans = a[b[0] - 2];
  }
  ans %= inf;
  for (long long i = 1; i < m; ++i) {
    if (b[i] - b[i - 1] == 1) {
      cout << 0 << endl;
      return 0;
    }
    ans *= a[b[i] - b[i - 1] - 3];
    ans %= inf;
  }
  long long sum = n - b[m - 1] - 2;
  ans *= a[sum];
  ans %= inf;
  cout << ans << endl;
}
