#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m, a[100005], f[100005], ans = 1, mod = 1000000007;
  int i;
  cin >> n >> m;
  f[0] = 1;
  f[1] = 1;
  for (i = 2; i <= n; i++) {
    f[i] = (f[i - 1] + f[i - 2]) % mod;
  }
  if (m == 0) {
    cout << f[n] << endl;
    return 0;
  }
  a[0] = 0;
  for (i = 1; i <= m; i++) {
    cin >> a[i];
    if (i == 1 && a[1] == 1)
      ans = 1;
    else if (a[i] - a[i - 1] == 1)
      ans = 0;
    else
      ans = (ans * f[a[i] - a[i - 1] - 2]) % mod;
  }
  ans = (ans * f[n - a[m] - 1]) % mod;
  cout << ans << endl;
  return 0;
}
