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