#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
using namespace std;

#define INF 1000000007

int function(int x, int y){
    long long int memo[x];
    if(x == 0 || x==1){
        memo[0]=y; memo[1]=y;
        return y;
    }
    else if(x >= 2){
        memo[x]= (function(x-1, y)+function(x-2, y))%INF;
        return memo[x];
    }

}

int main(void){
    int N, M;
    cin >> N >> M;
    int check[M+2];
    check[0]=0; check[M+1]=N;
    long long int ans = 1;
    for(int i = 1; i < M+1; i++)
        cin >> check[i];

    for(int i = 1; i < M+2; i++){
        if(check[i]==check[i-1]+1 && i!=1){
            ans = 0;
            break;  
        }
        else if(i==1 || i==M+1)
            ans=function(check[i]-check[i-1]-1, ans);
        else if(i>1)
            ans=function(check[i]-check[i-1]-2, ans);
    }

   cout << ans << endl;
    return 0;
}