import java.util.*;

public class Main {
    static int MOD = 1000000007;
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        
        int n = sc.nextInt();
        int m = sc.nextInt();
        int[] broken = new int[m];
        for (int i = 0; i < m; i++) {
            broken[i] = sc.nextInt();
            
            if (i > 0 && broken[i] - broken[i - 1] == 1) {
                System.out.println("0");
                return;
            }
        }
        
        int oldNum = 0;
        long count = 1;
        
        for (int i = 0; i < m; i++) {
            int num = broken[i];
            count = count * fibonacci((num - 1) - oldNum) % MOD;
            oldNum = num + 1;
        }
        
        count = count * fibonacci(n - oldNum) % MOD;
        
        System.out.println(count);
    }
    
    public static long fibonacci(long n) {
        long num1 = 1;
        long num2 = 1;
        long tmp = 1;
        
        for (long i = 1; i < n; i++) {
            tmp = (num1 + num2) % MOD;
            num1 = num2;
            num2 = tmp;
        }
        
        return tmp;
    }
} import java.util.*; util.* java public class Main {
    static int MOD = 1000000007;
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        
        int n = sc.nextInt();
        int m = sc.nextInt();
        int[] broken = new int[m];
        for (int i = 0; i < m; i++) {
            broken[i] = sc.nextInt();
            
            if (i > 0 && broken[i] - broken[i - 1] == 1) {
                System.out.println("0");
                return;
            }
        }
        
        int oldNum = 0;
        long count = 1;
        
        for (int i = 0; i < m; i++) {
            int num = broken[i];
            count = count * fibonacci((num - 1) - oldNum) % MOD;
            oldNum = num + 1;
        }
        
        count = count * fibonacci(n - oldNum) % MOD;
        
        System.out.println(count);
    }
    
    public static long fibonacci(long n) {
        long num1 = 1;
        long num2 = 1;
        long tmp = 1;
        
        for (long i = 1; i < n; i++) {
            tmp = (num1 + num2) % MOD;
            num1 = num2;
            num2 = tmp;
        }
        
        return tmp;
    }
} Main static int MOD = 1000000007; MOD 1000000007 public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        
        int n = sc.nextInt();
        int m = sc.nextInt();
        int[] broken = new int[m];
        for (int i = 0; i < m; i++) {
            broken[i] = sc.nextInt();
            
            if (i > 0 && broken[i] - broken[i - 1] == 1) {
                System.out.println("0");
                return;
            }
        }
        
        int oldNum = 0;
        long count = 1;
        
        for (int i = 0; i < m; i++) {
            int num = broken[i];
            count = count * fibonacci((num - 1) - oldNum) % MOD;
            oldNum = num + 1;
        }
        
        count = count * fibonacci(n - oldNum) % MOD;
        
        System.out.println(count);
    } main {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        
        int n = sc.nextInt();
        int m = sc.nextInt();
        int[] broken = new int[m];
        for (int i = 0; i < m; i++) {
            broken[i] = sc.nextInt();
            
            if (i > 0 && broken[i] - broken[i - 1] == 1) {
                System.out.println("0");
                return;
            }
        }
        
        int oldNum = 0;
        long count = 1;
        
        for (int i = 0; i < m; i++) {
            int num = broken[i];
            count = count * fibonacci((num - 1) - oldNum) % MOD;
            oldNum = num + 1;
        }
        
        count = count * fibonacci(n - oldNum) % MOD;
        
        System.out.println(count);
    } 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[] broken = new int[m]; broken new int[m] m for (int i = 0; i < m; i++) {
            broken[i] = sc.nextInt();
            
            if (i > 0 && broken[i] - broken[i - 1] == 1) {
                System.out.println("0");
                return;
            }
        } int i = 0; int i = 0; i 0 i < m i m i++ i++ i {
            broken[i] = sc.nextInt();
            
            if (i > 0 && broken[i] - broken[i - 1] == 1) {
                System.out.println("0");
                return;
            }
        } {
            broken[i] = sc.nextInt();
            
            if (i > 0 && broken[i] - broken[i - 1] == 1) {
                System.out.println("0");
                return;
            }
        } broken[i] = sc.nextInt() broken[i] broken i sc.nextInt() sc.nextInt sc if (i > 0 && broken[i] - broken[i - 1] == 1) {
                System.out.println("0");
                return;
            } i > 0 && broken[i] - broken[i - 1] == 1 i > 0 i 0 broken[i] - broken[i - 1] == 1 broken[i] - broken[i - 1] broken[i] broken i broken[i - 1] broken i - 1 i 1 1 {
                System.out.println("0");
                return;
            } System.out.println("0") System.out.println System.out System System.out "0" return; int oldNum = 0; oldNum 0 long count = 1; count 1 for (int i = 0; i < m; i++) {
            int num = broken[i];
            count = count * fibonacci((num - 1) - oldNum) % MOD;
            oldNum = num + 1;
        } int i = 0; int i = 0; i 0 i < m i m i++ i++ i {
            int num = broken[i];
            count = count * fibonacci((num - 1) - oldNum) % MOD;
            oldNum = num + 1;
        } {
            int num = broken[i];
            count = count * fibonacci((num - 1) - oldNum) % MOD;
            oldNum = num + 1;
        } int num = broken[i]; num broken[i] broken i count = count * fibonacci((num - 1) - oldNum) % MOD count count * fibonacci((num - 1) - oldNum) % MOD count * fibonacci((num - 1) - oldNum) count fibonacci((num - 1) - oldNum) fibonacci (num - 1) - oldNum (num - 1) num 1 oldNum MOD oldNum = num + 1 oldNum num + 1 num 1 count = count * fibonacci(n - oldNum) % MOD count count * fibonacci(n - oldNum) % MOD count * fibonacci(n - oldNum) count fibonacci(n - oldNum) fibonacci n - oldNum n oldNum MOD System.out.println(count) System.out.println System.out System System.out count String[] args args public static long fibonacci(long n) {
        long num1 = 1;
        long num2 = 1;
        long tmp = 1;
        
        for (long i = 1; i < n; i++) {
            tmp = (num1 + num2) % MOD;
            num1 = num2;
            num2 = tmp;
        }
        
        return tmp;
    } fibonacci {
        long num1 = 1;
        long num2 = 1;
        long tmp = 1;
        
        for (long i = 1; i < n; i++) {
            tmp = (num1 + num2) % MOD;
            num1 = num2;
            num2 = tmp;
        }
        
        return tmp;
    } long num1 = 1; num1 1 long num2 = 1; num2 1 long tmp = 1; tmp 1 for (long i = 1; i < n; i++) {
            tmp = (num1 + num2) % MOD;
            num1 = num2;
            num2 = tmp;
        } long i = 1; long i = 1; i 1 i < n i n i++ i++ i {
            tmp = (num1 + num2) % MOD;
            num1 = num2;
            num2 = tmp;
        } {
            tmp = (num1 + num2) % MOD;
            num1 = num2;
            num2 = tmp;
        } tmp = (num1 + num2) % MOD tmp (num1 + num2) % MOD (num1 + num2) num1 num2 MOD num1 = num2 num1 num2 num2 = tmp num2 tmp return tmp; tmp long n n public class Main {
    static int MOD = 1000000007;
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        
        int n = sc.nextInt();
        int m = sc.nextInt();
        int[] broken = new int[m];
        for (int i = 0; i < m; i++) {
            broken[i] = sc.nextInt();
            
            if (i > 0 && broken[i] - broken[i - 1] == 1) {
                System.out.println("0");
                return;
            }
        }
        
        int oldNum = 0;
        long count = 1;
        
        for (int i = 0; i < m; i++) {
            int num = broken[i];
            count = count * fibonacci((num - 1) - oldNum) % MOD;
            oldNum = num + 1;
        }
        
        count = count * fibonacci(n - oldNum) % MOD;
        
        System.out.println(count);
    }
    
    public static long fibonacci(long n) {
        long num1 = 1;
        long num2 = 1;
        long tmp = 1;
        
        for (long i = 1; i < n; i++) {
            tmp = (num1 + num2) % MOD;
            num1 = num2;
            num2 = tmp;
        }
        
        return tmp;
    }
} public class Main {
    static int MOD = 1000000007;
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        
        int n = sc.nextInt();
        int m = sc.nextInt();
        int[] broken = new int[m];
        for (int i = 0; i < m; i++) {
            broken[i] = sc.nextInt();
            
            if (i > 0 && broken[i] - broken[i - 1] == 1) {
                System.out.println("0");
                return;
            }
        }
        
        int oldNum = 0;
        long count = 1;
        
        for (int i = 0; i < m; i++) {
            int num = broken[i];
            count = count * fibonacci((num - 1) - oldNum) % MOD;
            oldNum = num + 1;
        }
        
        count = count * fibonacci(n - oldNum) % MOD;
        
        System.out.println(count);
    }
    
    public static long fibonacci(long n) {
        long num1 = 1;
        long num2 = 1;
        long tmp = 1;
        
        for (long i = 1; i < n; i++) {
            tmp = (num1 + num2) % MOD;
            num1 = num2;
            num2 = tmp;
        }
        
        return tmp;
    }
} Main
import java.util.*;

public class Main {
    static int MOD = 1000000007;
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        
        int n = sc.nextInt();
        int m = sc.nextInt();
        int[] broken = new int[m];
        for (int i = 0; i < m; i++) {
            broken[i] = sc.nextInt();
            
            if (i > 0 && broken[i] - broken[i - 1] == 1) {
                System.out.println("0");
                return;
            }
        }
        
        int oldNum = 0;
        long count = 1;
        
        for (int i = 0; i < m; i++) {
            int num = broken[i];
            count = count * fibonacci((num - 1) - oldNum) % MOD;
            oldNum = num + 1;
        }
        
        count = count * fibonacci(n - oldNum) % MOD;
        
        System.out.println(count);
    }
    
    public static long fibonacci(long n) {
        long num1 = 1;
        long num2 = 1;
        long tmp = 1;
        
        for (long i = 1; i < n; i++) {
            tmp = (num1 + num2) % MOD;
            num1 = num2;
            num2 = tmp;
        }
        
        return tmp;
    }
}
