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