#include <bits/stdc++.h>
using namespace std;

function fib(int n) {
  int num1=1, num2=1, tmp=1;
  
  for(int i = 1; i<n; i++) {
    tmp = num1 + num2;
    num1 = num2;
    num2 = tmp;
  }
  return tmp;
}

int main() {
  int n, m, r=1;
  
  cin >> n >> m;
  int a[m+2];
  for(int i=1;i<=m;i++)
    cin >> a[i];
  a[0] = -1;
  a[m+2] = -1;
  for(int i=1;a[i]!=-1;i++)
    r *= fib(a[i] - a[i-1] - 1);
  
  r = r % 1000000007;
  
  cout << r << endl;
  
  return 0;
  
}
