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;
    }
}

/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz