#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int a[100000], m;
ll dfs(int p, int n) {
  ll tmp = 0;
  if (p == n) return 1;
  if (p > n) return 0;
  tmp += dfs(p + 1, n);
  tmp += dfs(p + 2, n);
  return tmp;
}
int main() {
  int n;
  ll ans = 1;
  cin >> n >> m;
  a[0] = -1;
  for (int i = 0; i < m; i++) cin >> a[i];
  ans *= dfs(0, a[0] - 1) % 1000000007;
  for (int i = 1; i < m; i++) {
    ans *= dfs(a[i - 1] + 1, a[i] - 1) % 1000000007;
  }
  ans *= dfs(a[m - 1] + 1, n) % 1000000007;
  cout << ans % 1000000007;
  return 0;
}
