import java.util.*;

public class Main {
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int m=sc.nextInt();
        int a[]=new int[m];
        int b[]=new int[m+1];
        int fib[]=new int[n+2];
        fib[0]=0;
        fib[1]=1;
        for(int i=2;i<n+2;i++){
            fib[i]=fib[i-1]+fib[i-2];
            fib[i]%=1000000007;
        }
        int po=-1;
        for(int i=0;i<m;i++){
            a[i]=sc.nextInt();
            b[i]=a[i]-po-1;
            po=a[i];
        }
        b[m]=n-po;
        long ans=1;
        for(int i=0;i<m+1;i++){
            //System.out.println(b[i]);
            ans*=fib[b[i]];
            ans%=1000000007;
        }
        System.out.println(ans);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int m=sc.nextInt();
        int a[]=new int[m];
        int b[]=new int[m+1];
        int fib[]=new int[n+2];
        fib[0]=0;
        fib[1]=1;
        for(int i=2;i<n+2;i++){
            fib[i]=fib[i-1]+fib[i-2];
            fib[i]%=1000000007;
        }
        int po=-1;
        for(int i=0;i<m;i++){
            a[i]=sc.nextInt();
            b[i]=a[i]-po-1;
            po=a[i];
        }
        b[m]=n-po;
        long ans=1;
        for(int i=0;i<m+1;i++){
            //System.out.println(b[i]);
            ans*=fib[b[i]];
            ans%=1000000007;
        }
        System.out.println(ans);
    }
} Main public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int m=sc.nextInt();
        int a[]=new int[m];
        int b[]=new int[m+1];
        int fib[]=new int[n+2];
        fib[0]=0;
        fib[1]=1;
        for(int i=2;i<n+2;i++){
            fib[i]=fib[i-1]+fib[i-2];
            fib[i]%=1000000007;
        }
        int po=-1;
        for(int i=0;i<m;i++){
            a[i]=sc.nextInt();
            b[i]=a[i]-po-1;
            po=a[i];
        }
        b[m]=n-po;
        long ans=1;
        for(int i=0;i<m+1;i++){
            //System.out.println(b[i]);
            ans*=fib[b[i]];
            ans%=1000000007;
        }
        System.out.println(ans);
    } main {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int m=sc.nextInt();
        int a[]=new int[m];
        int b[]=new int[m+1];
        int fib[]=new int[n+2];
        fib[0]=0;
        fib[1]=1;
        for(int i=2;i<n+2;i++){
            fib[i]=fib[i-1]+fib[i-2];
            fib[i]%=1000000007;
        }
        int po=-1;
        for(int i=0;i<m;i++){
            a[i]=sc.nextInt();
            b[i]=a[i]-po-1;
            po=a[i];
        }
        b[m]=n-po;
        long ans=1;
        for(int i=0;i<m+1;i++){
            //System.out.println(b[i]);
            ans*=fib[b[i]];
            ans%=1000000007;
        }
        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 int b[]=new int[m+1]; b new int[m+1] m+1 m 1 int fib[]=new int[n+2]; fib new int[n+2] n+2 n 2 fib[0]=0 fib[0] fib 0 0 fib[1]=1 fib[1] fib 1 1 for(int i=2;i<n+2;i++){
            fib[i]=fib[i-1]+fib[i-2];
            fib[i]%=1000000007;
        } int i=2; int i=2; i 2 i<n+2 i n+2 n 2 i++ i++ i {
            fib[i]=fib[i-1]+fib[i-2];
            fib[i]%=1000000007;
        } {
            fib[i]=fib[i-1]+fib[i-2];
            fib[i]%=1000000007;
        } fib[i]=fib[i-1]+fib[i-2] fib[i] fib i fib[i-1]+fib[i-2] fib[i-1] fib i-1 i 1 fib[i-2] fib i-2 i 2 fib[i]%=1000000007 fib[i] fib i 1000000007 int po=-1; po -1 1 for(int i=0;i<m;i++){
            a[i]=sc.nextInt();
            b[i]=a[i]-po-1;
            po=a[i];
        } int i=0; int i=0; i 0 i<m i m i++ i++ i {
            a[i]=sc.nextInt();
            b[i]=a[i]-po-1;
            po=a[i];
        } {
            a[i]=sc.nextInt();
            b[i]=a[i]-po-1;
            po=a[i];
        } a[i]=sc.nextInt() a[i] a i sc.nextInt() sc.nextInt sc b[i]=a[i]-po-1 b[i] b i a[i]-po-1 a[i]-po-1 a[i] a i po 1 po=a[i] po a[i] a i b[m]=n-po b[m] b m n-po n po long ans=1; ans 1 for(int i=0;i<m+1;i++){
            //System.out.println(b[i]);
            ans*=fib[b[i]];
            ans%=1000000007;
        } int i=0; int i=0; i 0 i<m+1 i m+1 m 1 i++ i++ i {
            //System.out.println(b[i]);
            ans*=fib[b[i]];
            ans%=1000000007;
        } {
            //System.out.println(b[i]);
            ans*=fib[b[i]];
            ans%=1000000007;
        } ans*=fib[b[i]] ans fib[b[i]] fib b[i] b i ans%=1000000007 ans 1000000007 System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int m=sc.nextInt();
        int a[]=new int[m];
        int b[]=new int[m+1];
        int fib[]=new int[n+2];
        fib[0]=0;
        fib[1]=1;
        for(int i=2;i<n+2;i++){
            fib[i]=fib[i-1]+fib[i-2];
            fib[i]%=1000000007;
        }
        int po=-1;
        for(int i=0;i<m;i++){
            a[i]=sc.nextInt();
            b[i]=a[i]-po-1;
            po=a[i];
        }
        b[m]=n-po;
        long ans=1;
        for(int i=0;i<m+1;i++){
            //System.out.println(b[i]);
            ans*=fib[b[i]];
            ans%=1000000007;
        }
        System.out.println(ans);
    }
} public class Main {
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int m=sc.nextInt();
        int a[]=new int[m];
        int b[]=new int[m+1];
        int fib[]=new int[n+2];
        fib[0]=0;
        fib[1]=1;
        for(int i=2;i<n+2;i++){
            fib[i]=fib[i-1]+fib[i-2];
            fib[i]%=1000000007;
        }
        int po=-1;
        for(int i=0;i<m;i++){
            a[i]=sc.nextInt();
            b[i]=a[i]-po-1;
            po=a[i];
        }
        b[m]=n-po;
        long ans=1;
        for(int i=0;i<m+1;i++){
            //System.out.println(b[i]);
            ans*=fib[b[i]];
            ans%=1000000007;
        }
        System.out.println(ans);
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int m=sc.nextInt();
        int a[]=new int[m];
        int b[]=new int[m+1];
        int fib[]=new int[n+2];
        fib[0]=0;
        fib[1]=1;
        for(int i=2;i<n+2;i++){
            fib[i]=fib[i-1]+fib[i-2];
            fib[i]%=1000000007;
        }
        int po=-1;
        for(int i=0;i<m;i++){
            a[i]=sc.nextInt();
            b[i]=a[i]-po-1;
            po=a[i];
        }
        b[m]=n-po;
        long ans=1;
        for(int i=0;i<m+1;i++){
            //System.out.println(b[i]);
            ans*=fib[b[i]];
            ans%=1000000007;
        }
        System.out.println(ans);
    }
}
