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