import java.util.*;

class Main {
    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 + 2];
        for (int i = 1; i <= m; i++) {
            a[i] = Integer.parseInt(sc.next());
        }
        sc.close();
        a[0] = -1;
        a[m + 1] = n + 1;
        List<Integer> b = new ArrayList<>();
        for (int i = 1; i <= m + 1; i++) {
            if (a[i] - a[i - 1] == 1) {
                System.out.println(0);
                return;
            }
            b.add(a[i] - a[i - 1] - 1);
        }
        if (m == 0) {
            b.set(0, n + 1);
        }
        long memo[] = new long[n + 2];
        memo[1] = 1;
        memo[2] = 1;
        for (int i = 3; i <= n + 1; i++) {
            memo[i] = memo[i - 1] + memo[i - 2];
            memo[i] %= 1_000_000_007;
        }
        long ans = 1;
        for (int i = 0; i < b.size(); i++) {
            ans *= memo[b.get(i)];
            ans %= 1_000_000_007;
        }
        System.out.print(ans);
    }
} import java.util.*; util.* java class Main {
    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 + 2];
        for (int i = 1; i <= m; i++) {
            a[i] = Integer.parseInt(sc.next());
        }
        sc.close();
        a[0] = -1;
        a[m + 1] = n + 1;
        List<Integer> b = new ArrayList<>();
        for (int i = 1; i <= m + 1; i++) {
            if (a[i] - a[i - 1] == 1) {
                System.out.println(0);
                return;
            }
            b.add(a[i] - a[i - 1] - 1);
        }
        if (m == 0) {
            b.set(0, n + 1);
        }
        long memo[] = new long[n + 2];
        memo[1] = 1;
        memo[2] = 1;
        for (int i = 3; i <= n + 1; i++) {
            memo[i] = memo[i - 1] + memo[i - 2];
            memo[i] %= 1_000_000_007;
        }
        long ans = 1;
        for (int i = 0; i < b.size(); i++) {
            ans *= memo[b.get(i)];
            ans %= 1_000_000_007;
        }
        System.out.print(ans);
    }
} Main 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 + 2];
        for (int i = 1; i <= m; i++) {
            a[i] = Integer.parseInt(sc.next());
        }
        sc.close();
        a[0] = -1;
        a[m + 1] = n + 1;
        List<Integer> b = new ArrayList<>();
        for (int i = 1; i <= m + 1; i++) {
            if (a[i] - a[i - 1] == 1) {
                System.out.println(0);
                return;
            }
            b.add(a[i] - a[i - 1] - 1);
        }
        if (m == 0) {
            b.set(0, n + 1);
        }
        long memo[] = new long[n + 2];
        memo[1] = 1;
        memo[2] = 1;
        for (int i = 3; i <= n + 1; i++) {
            memo[i] = memo[i - 1] + memo[i - 2];
            memo[i] %= 1_000_000_007;
        }
        long ans = 1;
        for (int i = 0; i < b.size(); i++) {
            ans *= memo[b.get(i)];
            ans %= 1_000_000_007;
        }
        System.out.print(ans);
    } main {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int m = Integer.parseInt(sc.next());
        int a[] = new int[m + 2];
        for (int i = 1; i <= m; i++) {
            a[i] = Integer.parseInt(sc.next());
        }
        sc.close();
        a[0] = -1;
        a[m + 1] = n + 1;
        List<Integer> b = new ArrayList<>();
        for (int i = 1; i <= m + 1; i++) {
            if (a[i] - a[i - 1] == 1) {
                System.out.println(0);
                return;
            }
            b.add(a[i] - a[i - 1] - 1);
        }
        if (m == 0) {
            b.set(0, n + 1);
        }
        long memo[] = new long[n + 2];
        memo[1] = 1;
        memo[2] = 1;
        for (int i = 3; i <= n + 1; i++) {
            memo[i] = memo[i - 1] + memo[i - 2];
            memo[i] %= 1_000_000_007;
        }
        long ans = 1;
        for (int i = 0; i < b.size(); i++) {
            ans *= memo[b.get(i)];
            ans %= 1_000_000_007;
        }
        System.out.print(ans);
    } 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 + 2]; a new int[m + 2] m + 2 m 2 for (int i = 1; i <= m; i++) {
            a[i] = Integer.parseInt(sc.next());
        } int i = 1; int i = 1; i 1 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 sc.close() sc.close sc a[0] = -1 a[0] a 0 -1 1 a[m + 1] = n + 1 a[m + 1] a m + 1 m 1 n + 1 n 1 List<Integer> b = new ArrayList<>(); b new ArrayList<>() for (int i = 1; i <= m + 1; i++) {
            if (a[i] - a[i - 1] == 1) {
                System.out.println(0);
                return;
            }
            b.add(a[i] - a[i - 1] - 1);
        } int i = 1; int i = 1; i 1 i <= m + 1 i m + 1 m 1 i++ i++ i {
            if (a[i] - a[i - 1] == 1) {
                System.out.println(0);
                return;
            }
            b.add(a[i] - a[i - 1] - 1);
        } {
            if (a[i] - a[i - 1] == 1) {
                System.out.println(0);
                return;
            }
            b.add(a[i] - a[i - 1] - 1);
        } 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; b.add(a[i] - a[i - 1] - 1) b.add b a[i] - a[i - 1] - 1 a[i] - a[i - 1] - 1 a[i] a i a[i - 1] a i - 1 i 1 1 if (m == 0) {
            b.set(0, n + 1);
        } m == 0 m 0 {
            b.set(0, n + 1);
        } b.set(0, n + 1) b.set b 0 n + 1 n 1 long memo[] = new long[n + 2]; memo new long[n + 2] n + 2 n 2 memo[1] = 1 memo[1] memo 1 1 memo[2] = 1 memo[2] memo 2 1 for (int i = 3; i <= n + 1; i++) {
            memo[i] = memo[i - 1] + memo[i - 2];
            memo[i] %= 1_000_000_007;
        } int i = 3; int i = 3; i 3 i <= n + 1 i n + 1 n 1 i++ i++ i {
            memo[i] = memo[i - 1] + memo[i - 2];
            memo[i] %= 1_000_000_007;
        } {
            memo[i] = memo[i - 1] + memo[i - 2];
            memo[i] %= 1_000_000_007;
        } memo[i] = memo[i - 1] + memo[i - 2] memo[i] memo i memo[i - 1] + memo[i - 2] memo[i - 1] memo i - 1 i 1 memo[i - 2] memo i - 2 i 2 memo[i] %= 1_000_000_007 memo[i] memo i 1_000_000_007 long ans = 1; ans 1 for (int i = 0; i < b.size(); i++) {
            ans *= memo[b.get(i)];
            ans %= 1_000_000_007;
        } int i = 0; int i = 0; i 0 i < b.size() i b.size() b.size b i++ i++ i {
            ans *= memo[b.get(i)];
            ans %= 1_000_000_007;
        } {
            ans *= memo[b.get(i)];
            ans %= 1_000_000_007;
        } ans *= memo[b.get(i)] ans memo[b.get(i)] memo b.get(i) b.get b i ans %= 1_000_000_007 ans 1_000_000_007 System.out.print(ans) System.out.print System.out System System.out ans String[] args args
import java.util.*;

class Main {
    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 + 2];
        for (int i = 1; i <= m; i++) {
            a[i] = Integer.parseInt(sc.next());
        }
        sc.close();
        a[0] = -1;
        a[m + 1] = n + 1;
        List<Integer> b = new ArrayList<>();
        for (int i = 1; i <= m + 1; i++) {
            if (a[i] - a[i - 1] == 1) {
                System.out.println(0);
                return;
            }
            b.add(a[i] - a[i - 1] - 1);
        }
        if (m == 0) {
            b.set(0, n + 1);
        }
        long memo[] = new long[n + 2];
        memo[1] = 1;
        memo[2] = 1;
        for (int i = 3; i <= n + 1; i++) {
            memo[i] = memo[i - 1] + memo[i - 2];
            memo[i] %= 1_000_000_007;
        }
        long ans = 1;
        for (int i = 0; i < b.size(); i++) {
            ans *= memo[b.get(i)];
            ans %= 1_000_000_007;
        }
        System.out.print(ans);
    }
}