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