#include <bits/stdc++.h>
using namespace std;
const int r = 1e9 + 7;
long long ans = 1;
int n, m, a, b = 0, q[50005], f1, maxn = 0, f[100005];
int main() {
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    cin >> a;
    q[i] = a - b - 1;
    maxn = max(maxn, q[i]);
    b = a + 1;
  }
  q[m + 1] = n - a - 1;
  f[0] = 1;
  f[1] = 1;
  f[2] = 2;
  for (int i = 3; i <= maxn; i++) f[i] = (f[i - 1] + f[i - 2]) % r;
  for (int i = 1; i <= m + 1; i++) {
    ans *= f[q[i]];
    ans %= r;
  }
  cout << ans % r << endl;
  return 0;
}
