import java.util.*;
//mport java.io.*;


public class Main{

    static int INFTY = Integer.MAX_VALUE;
    static long num=1000000007;
    public static void main (String args[]){
        //初期処理
        Scanner sc=new Scanner(System.in);
        // BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        // try{
            // int n = Integer.parseInt(br.readLine());
        int n = sc.nextInt();
        int m = sc.nextInt();
        int[] a = new int[m];
        for (int i=0;i<m;i++){
            a[i] = sc.nextInt();
            if(i==0){continue;}
        //2連続で壊れてたら0で終了
            if(a[i]-a[i-1]==1){
                System.out.println(0);
                return;
            }
        }
        long[] f = new long[n+1];
        f[0]=1;
        f[1]=1;
        for(int i=2;i<=n;i++){
            f[i] = (f[i-1] + f[i-2]) % num;
        }
        //壊れてない場合は区間分けすると死亡
        if(m==0){
            System.out.println(f[n]);
            return;
        }
        //最初の区間は特別
        long ans = f[a[0]-1] % num;

        for(int i=1;i<m;i++){
            //ans = ( ans % num ) * (f[a[i]-a[i-1]-1] % num ) * (f[a[i+1]-a[i]-1] % num) % num;
            ans = ( ans % num ) * (f[a[i]-a[i-1]-2]) % num;
        }
        //最後の区間も特別
        ans = ( ans % num ) * (f[n-a[m-1]-1]) % num;
        System.out.println(ans);
    }
        

} import java.util.*; util.* java public class Main{

    static int INFTY = Integer.MAX_VALUE;
    static long num=1000000007;
    public static void main (String args[]){
        //初期処理
        Scanner sc=new Scanner(System.in);
        // BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        // try{
            // int n = Integer.parseInt(br.readLine());
        int n = sc.nextInt();
        int m = sc.nextInt();
        int[] a = new int[m];
        for (int i=0;i<m;i++){
            a[i] = sc.nextInt();
            if(i==0){continue;}
        //2連続で壊れてたら0で終了
            if(a[i]-a[i-1]==1){
                System.out.println(0);
                return;
            }
        }
        long[] f = new long[n+1];
        f[0]=1;
        f[1]=1;
        for(int i=2;i<=n;i++){
            f[i] = (f[i-1] + f[i-2]) % num;
        }
        //壊れてない場合は区間分けすると死亡
        if(m==0){
            System.out.println(f[n]);
            return;
        }
        //最初の区間は特別
        long ans = f[a[0]-1] % num;

        for(int i=1;i<m;i++){
            //ans = ( ans % num ) * (f[a[i]-a[i-1]-1] % num ) * (f[a[i+1]-a[i]-1] % num) % num;
            ans = ( ans % num ) * (f[a[i]-a[i-1]-2]) % num;
        }
        //最後の区間も特別
        ans = ( ans % num ) * (f[n-a[m-1]-1]) % num;
        System.out.println(ans);
    }
        

} Main static int INFTY = Integer.MAX_VALUE; INFTY Integer.MAX_VALUE Integer Integer.MAX_VALUE static long num=1000000007; num 1000000007 public static void main (String args[]){
        //初期処理
        Scanner sc=new Scanner(System.in);
        // BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        // try{
            // int n = Integer.parseInt(br.readLine());
        int n = sc.nextInt();
        int m = sc.nextInt();
        int[] a = new int[m];
        for (int i=0;i<m;i++){
            a[i] = sc.nextInt();
            if(i==0){continue;}
        //2連続で壊れてたら0で終了
            if(a[i]-a[i-1]==1){
                System.out.println(0);
                return;
            }
        }
        long[] f = new long[n+1];
        f[0]=1;
        f[1]=1;
        for(int i=2;i<=n;i++){
            f[i] = (f[i-1] + f[i-2]) % num;
        }
        //壊れてない場合は区間分けすると死亡
        if(m==0){
            System.out.println(f[n]);
            return;
        }
        //最初の区間は特別
        long ans = f[a[0]-1] % num;

        for(int i=1;i<m;i++){
            //ans = ( ans % num ) * (f[a[i]-a[i-1]-1] % num ) * (f[a[i+1]-a[i]-1] % num) % num;
            ans = ( ans % num ) * (f[a[i]-a[i-1]-2]) % num;
        }
        //最後の区間も特別
        ans = ( ans % num ) * (f[n-a[m-1]-1]) % num;
        System.out.println(ans);
    } main {
        //初期処理
        Scanner sc=new Scanner(System.in);
        // BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        // try{
            // int n = Integer.parseInt(br.readLine());
        int n = sc.nextInt();
        int m = sc.nextInt();
        int[] a = new int[m];
        for (int i=0;i<m;i++){
            a[i] = sc.nextInt();
            if(i==0){continue;}
        //2連続で壊れてたら0で終了
            if(a[i]-a[i-1]==1){
                System.out.println(0);
                return;
            }
        }
        long[] f = new long[n+1];
        f[0]=1;
        f[1]=1;
        for(int i=2;i<=n;i++){
            f[i] = (f[i-1] + f[i-2]) % num;
        }
        //壊れてない場合は区間分けすると死亡
        if(m==0){
            System.out.println(f[n]);
            return;
        }
        //最初の区間は特別
        long ans = f[a[0]-1] % num;

        for(int i=1;i<m;i++){
            //ans = ( ans % num ) * (f[a[i]-a[i-1]-1] % num ) * (f[a[i+1]-a[i]-1] % num) % num;
            ans = ( ans % num ) * (f[a[i]-a[i-1]-2]) % num;
        }
        //最後の区間も特別
        ans = ( ans % num ) * (f[n-a[m-1]-1]) % num;
        System.out.println(ans);
    } Scanner sc=new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int m = sc.nextInt(); m sc.nextInt() sc.nextInt sc int[] a = new int[m]; a new int[m] m for (int i=0;i<m;i++){
            a[i] = sc.nextInt();
            if(i==0){continue;}
        //2連続で壊れてたら0で終了
            if(a[i]-a[i-1]==1){
                System.out.println(0);
                return;
            }
        } int i=0; int i=0; i 0 i<m i m i++ i++ i {
            a[i] = sc.nextInt();
            if(i==0){continue;}
        //2連続で壊れてたら0で終了
            if(a[i]-a[i-1]==1){
                System.out.println(0);
                return;
            }
        } {
            a[i] = sc.nextInt();
            if(i==0){continue;}
        //2連続で壊れてたら0で終了
            if(a[i]-a[i-1]==1){
                System.out.println(0);
                return;
            }
        } a[i] = sc.nextInt() a[i] a i sc.nextInt() sc.nextInt sc if(i==0){continue;} i==0 i 0 {continue;} continue; if(a[i]-a[i-1]==1){
                System.out.println(0);
                return;
            } a[i]-a[i-1]==1 a[i]-a[i-1] a[i] a i a[i-1] a i-1 i 1 1 {
                System.out.println(0);
                return;
            } System.out.println(0) System.out.println System.out System System.out 0 return; long[] f = new long[n+1]; f new long[n+1] n+1 n 1 f[0]=1 f[0] f 0 1 f[1]=1 f[1] f 1 1 for(int i=2;i<=n;i++){
            f[i] = (f[i-1] + f[i-2]) % num;
        } int i=2; int i=2; i 2 i<=n i n i++ i++ i {
            f[i] = (f[i-1] + f[i-2]) % num;
        } {
            f[i] = (f[i-1] + f[i-2]) % num;
        } f[i] = (f[i-1] + f[i-2]) % num f[i] f i (f[i-1] + f[i-2]) % num (f[i-1] + f[i-2]) f[i-1] f i-1 i 1 f[i-2] f i-2 i 2 num if(m==0){
            System.out.println(f[n]);
            return;
        } m==0 m 0 {
            System.out.println(f[n]);
            return;
        } System.out.println(f[n]) System.out.println System.out System System.out f[n] f n return; long ans = f[a[0]-1] % num; ans f[a[0]-1] % num f[a[0]-1] f a[0]-1 a[0] a 0 1 num for(int i=1;i<m;i++){
            //ans = ( ans % num ) * (f[a[i]-a[i-1]-1] % num ) * (f[a[i+1]-a[i]-1] % num) % num;
            ans = ( ans % num ) * (f[a[i]-a[i-1]-2]) % num;
        } int i=1; int i=1; i 1 i<m i m i++ i++ i {
            //ans = ( ans % num ) * (f[a[i]-a[i-1]-1] % num ) * (f[a[i+1]-a[i]-1] % num) % num;
            ans = ( ans % num ) * (f[a[i]-a[i-1]-2]) % num;
        } {
            //ans = ( ans % num ) * (f[a[i]-a[i-1]-1] % num ) * (f[a[i+1]-a[i]-1] % num) % num;
            ans = ( ans % num ) * (f[a[i]-a[i-1]-2]) % num;
        } ans = ( ans % num ) * (f[a[i]-a[i-1]-2]) % num ans ( ans % num ) * (f[a[i]-a[i-1]-2]) % num ( ans % num ) * (f[a[i]-a[i-1]-2]) ( ans % num ) ans num (f[a[i]-a[i-1]-2]) f a[i]-a[i-1]-2 a[i]-a[i-1]-2 a[i] a i a[i-1] a i-1 i 1 2 num ans = ( ans % num ) * (f[n-a[m-1]-1]) % num ans ( ans % num ) * (f[n-a[m-1]-1]) % num ( ans % num ) * (f[n-a[m-1]-1]) ( ans % num ) ans num (f[n-a[m-1]-1]) f n-a[m-1]-1 n-a[m-1]-1 n a[m-1] a m-1 m 1 1 num System.out.println(ans) System.out.println System.out System System.out ans String args[] args public class Main{

    static int INFTY = Integer.MAX_VALUE;
    static long num=1000000007;
    public static void main (String args[]){
        //初期処理
        Scanner sc=new Scanner(System.in);
        // BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        // try{
            // int n = Integer.parseInt(br.readLine());
        int n = sc.nextInt();
        int m = sc.nextInt();
        int[] a = new int[m];
        for (int i=0;i<m;i++){
            a[i] = sc.nextInt();
            if(i==0){continue;}
        //2連続で壊れてたら0で終了
            if(a[i]-a[i-1]==1){
                System.out.println(0);
                return;
            }
        }
        long[] f = new long[n+1];
        f[0]=1;
        f[1]=1;
        for(int i=2;i<=n;i++){
            f[i] = (f[i-1] + f[i-2]) % num;
        }
        //壊れてない場合は区間分けすると死亡
        if(m==0){
            System.out.println(f[n]);
            return;
        }
        //最初の区間は特別
        long ans = f[a[0]-1] % num;

        for(int i=1;i<m;i++){
            //ans = ( ans % num ) * (f[a[i]-a[i-1]-1] % num ) * (f[a[i+1]-a[i]-1] % num) % num;
            ans = ( ans % num ) * (f[a[i]-a[i-1]-2]) % num;
        }
        //最後の区間も特別
        ans = ( ans % num ) * (f[n-a[m-1]-1]) % num;
        System.out.println(ans);
    }
        

} public class Main{

    static int INFTY = Integer.MAX_VALUE;
    static long num=1000000007;
    public static void main (String args[]){
        //初期処理
        Scanner sc=new Scanner(System.in);
        // BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        // try{
            // int n = Integer.parseInt(br.readLine());
        int n = sc.nextInt();
        int m = sc.nextInt();
        int[] a = new int[m];
        for (int i=0;i<m;i++){
            a[i] = sc.nextInt();
            if(i==0){continue;}
        //2連続で壊れてたら0で終了
            if(a[i]-a[i-1]==1){
                System.out.println(0);
                return;
            }
        }
        long[] f = new long[n+1];
        f[0]=1;
        f[1]=1;
        for(int i=2;i<=n;i++){
            f[i] = (f[i-1] + f[i-2]) % num;
        }
        //壊れてない場合は区間分けすると死亡
        if(m==0){
            System.out.println(f[n]);
            return;
        }
        //最初の区間は特別
        long ans = f[a[0]-1] % num;

        for(int i=1;i<m;i++){
            //ans = ( ans % num ) * (f[a[i]-a[i-1]-1] % num ) * (f[a[i+1]-a[i]-1] % num) % num;
            ans = ( ans % num ) * (f[a[i]-a[i-1]-2]) % num;
        }
        //最後の区間も特別
        ans = ( ans % num ) * (f[n-a[m-1]-1]) % num;
        System.out.println(ans);
    }
        

} Main
import java.util.*;
//mport java.io.*;


public class Main{

    static int INFTY = Integer.MAX_VALUE;
    static long num=1000000007;
    public static void main (String args[]){
        //初期処理
        Scanner sc=new Scanner(System.in);
        // BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        // try{
            // int n = Integer.parseInt(br.readLine());
        int n = sc.nextInt();
        int m = sc.nextInt();
        int[] a = new int[m];
        for (int i=0;i<m;i++){
            a[i] = sc.nextInt();
            if(i==0){continue;}
        //2連続で壊れてたら0で終了
            if(a[i]-a[i-1]==1){
                System.out.println(0);
                return;
            }
        }
        long[] f = new long[n+1];
        f[0]=1;
        f[1]=1;
        for(int i=2;i<=n;i++){
            f[i] = (f[i-1] + f[i-2]) % num;
        }
        //壊れてない場合は区間分けすると死亡
        if(m==0){
            System.out.println(f[n]);
            return;
        }
        //最初の区間は特別
        long ans = f[a[0]-1] % num;

        for(int i=1;i<m;i++){
            //ans = ( ans % num ) * (f[a[i]-a[i-1]-1] % num ) * (f[a[i+1]-a[i]-1] % num) % num;
            ans = ( ans % num ) * (f[a[i]-a[i-1]-2]) % num;
        }
        //最後の区間も特別
        ans = ( ans % num ) * (f[n-a[m-1]-1]) % num;
        System.out.println(ans);
    }
        

}