#include <iostream>

using namespace std;

int fib(int *p, int n)
{
  if (n < 0) return 0;
  if (p[n] != 0) return p[n];
  else return p[n] = fib(p, n-1) + fib(p, n-2);
}

int main()
{
  int n, m;
  cin >> n >> m;
  int f[n+1] = {1, 1};
  
  if (m == 0) cout << fib(f, n) % (10^9 + 7) << endl;
  else{
    int a[m+2];
    for (int i = 1; i < m + 1; i++) cin >> a[i];
    a[0] = (a[1] == 1) ? -1 : 0;
    a[m+1] = n+1;

    long sum = 1;
    for (int i = 1; i <= m + 1; i++) sum *= fib(f, a[i] - a[i-1] - 2 );

    cout << sum % (10^9 + 7) << endl;
  }
  return 0;
}
  
    