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