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