#include <iostream>
using namespace std;
int main(){
    long N,M;
    long SEKI;
    M=0;
    long kekkan[100002];
    SEKI=1;
    cin >> N >> M;
    kekkan[0]=-1;
    kekkan[M+1]=N+1;
    for(int i=1;i<M+1;i++){
        cin >> kekkan[i];
    }
    for(int j=0;j<M+1;j++){
        if (kekkan[j]==kekkan[j+1]-1){
            SEKI=0;
            break;
        }
        else{
            long a= 1; 
            long b= 0;
            long c= 0;
            for(int t = kekkan[j]+1;t< kekkan[j+1]-1; t++) {
            c=b;
            b=a;
            a=(a+c)%1000000007;
            }
            SEKI=(SEKI*a)%1000000007 ;

        }
    }
    cout << SEKI << endl;
