import java.util.Scanner;

public class Main {

    static int MOD = 1000000007;
    
    public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);
        
        int n = Integer.parseInt(sc.next());
        int m = Integer.parseInt(sc.next());
        int[] a = new int[m];
        for(int i = 0; i < m; i++){
            a[i] = Integer.parseInt(sc.next());
        }
        
        int[] f = new int[n+1];
        f[0] = 1;
        f[1] = 1;
        for(int i = 2; i <= n; i++){
            f[i] = (f[i-2] + f[i-1]) % MOD;
        }
        
        long count = 1;
        int length;
        if(m == 0){
            count = f[n];
        }else{
            length = a[0];
            if(length != 0){
                count = (count * f[length -1]) % MOD;
            }
            for(int i = 0; i < m-1; i++){
                length = a[i+1] - a[i] -1;
                if(length == 0){
                    System.out.println(0);
                    return;
                }
                count = (count * f[length -1]) % MOD;
            }
            length = n - a[m-1];
            if(length != 0){
                count = (count * f[length -1]) % MOD;
            }
        }
        
        System.out.println(count);
    }
} import java.util.Scanner; Scanner java.util public class Main {

    static int MOD = 1000000007;
    
    public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);
        
        int n = Integer.parseInt(sc.next());
        int m = Integer.parseInt(sc.next());
        int[] a = new int[m];
        for(int i = 0; i < m; i++){
            a[i] = Integer.parseInt(sc.next());
        }
        
        int[] f = new int[n+1];
        f[0] = 1;
        f[1] = 1;
        for(int i = 2; i <= n; i++){
            f[i] = (f[i-2] + f[i-1]) % MOD;
        }
        
        long count = 1;
        int length;
        if(m == 0){
            count = f[n];
        }else{
            length = a[0];
            if(length != 0){
                count = (count * f[length -1]) % MOD;
            }
            for(int i = 0; i < m-1; i++){
                length = a[i+1] - a[i] -1;
                if(length == 0){
                    System.out.println(0);
                    return;
                }
                count = (count * f[length -1]) % MOD;
            }
            length = n - a[m-1];
            if(length != 0){
                count = (count * f[length -1]) % MOD;
            }
        }
        
        System.out.println(count);
    }
} Main static int MOD = 1000000007; MOD 1000000007 public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);
        
        int n = Integer.parseInt(sc.next());
        int m = Integer.parseInt(sc.next());
        int[] a = new int[m];
        for(int i = 0; i < m; i++){
            a[i] = Integer.parseInt(sc.next());
        }
        
        int[] f = new int[n+1];
        f[0] = 1;
        f[1] = 1;
        for(int i = 2; i <= n; i++){
            f[i] = (f[i-2] + f[i-1]) % MOD;
        }
        
        long count = 1;
        int length;
        if(m == 0){
            count = f[n];
        }else{
            length = a[0];
            if(length != 0){
                count = (count * f[length -1]) % MOD;
            }
            for(int i = 0; i < m-1; i++){
                length = a[i+1] - a[i] -1;
                if(length == 0){
                    System.out.println(0);
                    return;
                }
                count = (count * f[length -1]) % MOD;
            }
            length = n - a[m-1];
            if(length != 0){
                count = (count * f[length -1]) % MOD;
            }
        }
        
        System.out.println(count);
    } main {
        
        Scanner sc = new Scanner(System.in);
        
        int n = Integer.parseInt(sc.next());
        int m = Integer.parseInt(sc.next());
        int[] a = new int[m];
        for(int i = 0; i < m; i++){
            a[i] = Integer.parseInt(sc.next());
        }
        
        int[] f = new int[n+1];
        f[0] = 1;
        f[1] = 1;
        for(int i = 2; i <= n; i++){
            f[i] = (f[i-2] + f[i-1]) % MOD;
        }
        
        long count = 1;
        int length;
        if(m == 0){
            count = f[n];
        }else{
            length = a[0];
            if(length != 0){
                count = (count * f[length -1]) % MOD;
            }
            for(int i = 0; i < m-1; i++){
                length = a[i+1] - a[i] -1;
                if(length == 0){
                    System.out.println(0);
                    return;
                }
                count = (count * f[length -1]) % MOD;
            }
            length = n - a[m-1];
            if(length != 0){
                count = (count * f[length -1]) % MOD;
            }
        }
        
        System.out.println(count);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = Integer.parseInt(sc.next()); n Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int m = Integer.parseInt(sc.next()); m Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int[] a = new int[m]; a new int[m] m for(int i = 0; i < m; i++){
            a[i] = Integer.parseInt(sc.next());
        } int i = 0; int i = 0; i 0 i < m i m i++ i++ i {
            a[i] = Integer.parseInt(sc.next());
        } {
            a[i] = Integer.parseInt(sc.next());
        } a[i] = Integer.parseInt(sc.next()) a[i] a i Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int[] f = new int[n+1]; f new int[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-2] + f[i-1]) % MOD;
        } int i = 2; int i = 2; i 2 i <= n i n i++ i++ i {
            f[i] = (f[i-2] + f[i-1]) % MOD;
        } {
            f[i] = (f[i-2] + f[i-1]) % MOD;
        } f[i] = (f[i-2] + f[i-1]) % MOD f[i] f i (f[i-2] + f[i-1]) % MOD (f[i-2] + f[i-1]) f[i-2] f i-2 i 2 f[i-1] f i-1 i 1 MOD long count = 1; count 1 int length; length if(m == 0){
            count = f[n];
        }else{
            length = a[0];
            if(length != 0){
                count = (count * f[length -1]) % MOD;
            }
            for(int i = 0; i < m-1; i++){
                length = a[i+1] - a[i] -1;
                if(length == 0){
                    System.out.println(0);
                    return;
                }
                count = (count * f[length -1]) % MOD;
            }
            length = n - a[m-1];
            if(length != 0){
                count = (count * f[length -1]) % MOD;
            }
        } m == 0 m 0 {
            count = f[n];
        } count = f[n] count f[n] f n {
            length = a[0];
            if(length != 0){
                count = (count * f[length -1]) % MOD;
            }
            for(int i = 0; i < m-1; i++){
                length = a[i+1] - a[i] -1;
                if(length == 0){
                    System.out.println(0);
                    return;
                }
                count = (count * f[length -1]) % MOD;
            }
            length = n - a[m-1];
            if(length != 0){
                count = (count * f[length -1]) % MOD;
            }
        } length = a[0] length a[0] a 0 if(length != 0){
                count = (count * f[length -1]) % MOD;
            } length != 0 length 0 {
                count = (count * f[length -1]) % MOD;
            } count = (count * f[length -1]) % MOD count (count * f[length -1]) % MOD (count * f[length -1]) count f[length -1] f length -1 length 1 MOD for(int i = 0; i < m-1; i++){
                length = a[i+1] - a[i] -1;
                if(length == 0){
                    System.out.println(0);
                    return;
                }
                count = (count * f[length -1]) % MOD;
            } int i = 0; int i = 0; i 0 i < m-1 i m-1 m 1 i++ i++ i {
                length = a[i+1] - a[i] -1;
                if(length == 0){
                    System.out.println(0);
                    return;
                }
                count = (count * f[length -1]) % MOD;
            } {
                length = a[i+1] - a[i] -1;
                if(length == 0){
                    System.out.println(0);
                    return;
                }
                count = (count * f[length -1]) % MOD;
            } length = a[i+1] - a[i] -1 length a[i+1] - a[i] -1 a[i+1] - a[i] -1 a[i+1] a i+1 i 1 a[i] a i 1 if(length == 0){
                    System.out.println(0);
                    return;
                } length == 0 length 0 {
                    System.out.println(0);
                    return;
                } System.out.println(0) System.out.println System.out System System.out 0 return; count = (count * f[length -1]) % MOD count (count * f[length -1]) % MOD (count * f[length -1]) count f[length -1] f length -1 length 1 MOD length = n - a[m-1] length n - a[m-1] n a[m-1] a m-1 m 1 if(length != 0){
                count = (count * f[length -1]) % MOD;
            } length != 0 length 0 {
                count = (count * f[length -1]) % MOD;
            } count = (count * f[length -1]) % MOD count (count * f[length -1]) % MOD (count * f[length -1]) count f[length -1] f length -1 length 1 MOD System.out.println(count) System.out.println System.out System System.out count String[] args args public class Main {

    static int MOD = 1000000007;
    
    public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);
        
        int n = Integer.parseInt(sc.next());
        int m = Integer.parseInt(sc.next());
        int[] a = new int[m];
        for(int i = 0; i < m; i++){
            a[i] = Integer.parseInt(sc.next());
        }
        
        int[] f = new int[n+1];
        f[0] = 1;
        f[1] = 1;
        for(int i = 2; i <= n; i++){
            f[i] = (f[i-2] + f[i-1]) % MOD;
        }
        
        long count = 1;
        int length;
        if(m == 0){
            count = f[n];
        }else{
            length = a[0];
            if(length != 0){
                count = (count * f[length -1]) % MOD;
            }
            for(int i = 0; i < m-1; i++){
                length = a[i+1] - a[i] -1;
                if(length == 0){
                    System.out.println(0);
                    return;
                }
                count = (count * f[length -1]) % MOD;
            }
            length = n - a[m-1];
            if(length != 0){
                count = (count * f[length -1]) % MOD;
            }
        }
        
        System.out.println(count);
    }
} public class Main {

    static int MOD = 1000000007;
    
    public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);
        
        int n = Integer.parseInt(sc.next());
        int m = Integer.parseInt(sc.next());
        int[] a = new int[m];
        for(int i = 0; i < m; i++){
            a[i] = Integer.parseInt(sc.next());
        }
        
        int[] f = new int[n+1];
        f[0] = 1;
        f[1] = 1;
        for(int i = 2; i <= n; i++){
            f[i] = (f[i-2] + f[i-1]) % MOD;
        }
        
        long count = 1;
        int length;
        if(m == 0){
            count = f[n];
        }else{
            length = a[0];
            if(length != 0){
                count = (count * f[length -1]) % MOD;
            }
            for(int i = 0; i < m-1; i++){
                length = a[i+1] - a[i] -1;
                if(length == 0){
                    System.out.println(0);
                    return;
                }
                count = (count * f[length -1]) % MOD;
            }
            length = n - a[m-1];
            if(length != 0){
                count = (count * f[length -1]) % MOD;
            }
        }
        
        System.out.println(count);
    }
} Main
import java.util.Scanner;

public class Main {

    static int MOD = 1000000007;
    
    public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);
        
        int n = Integer.parseInt(sc.next());
        int m = Integer.parseInt(sc.next());
        int[] a = new int[m];
        for(int i = 0; i < m; i++){
            a[i] = Integer.parseInt(sc.next());
        }
        
        int[] f = new int[n+1];
        f[0] = 1;
        f[1] = 1;
        for(int i = 2; i <= n; i++){
            f[i] = (f[i-2] + f[i-1]) % MOD;
        }
        
        long count = 1;
        int length;
        if(m == 0){
            count = f[n];
        }else{
            length = a[0];
            if(length != 0){
                count = (count * f[length -1]) % MOD;
            }
            for(int i = 0; i < m-1; i++){
                length = a[i+1] - a[i] -1;
                if(length == 0){
                    System.out.println(0);
                    return;
                }
                count = (count * f[length -1]) % MOD;
            }
            length = n - a[m-1];
            if(length != 0){
                count = (count * f[length -1]) % MOD;
            }
        }
        
        System.out.println(count);
    }
}