import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        int[] holeIndices = new int[M];

        for (int i=0; i<M; i++) {
            holeIndices[i] = sc.nextInt() - 1;
        }

        boolean[] holes = new boolean[N];
        for (int i=0; i<N; i++) {
            holes[i] = false;
        }
        for (int index : holeIndices) {
            holes[index] = true;
        }

        if (holes[0] && holes[1]) {
            System.out.println(0);
            return;
        }

        List<Integer> dp = new ArrayList<>();
        dp.add(1);
        if (!holes[0]) {
            dp.add(2);
        } else {
            dp.add(1);
        }

        for (int i=2; i<N; i++) {
            if (holes[i]) {
                if (holes[i-1]) {
                    System.out.println(0);
                    return;
                } else {
                    dp.add(dp.get(i-1));
                }
            } else {
                if (!holes[i-1] && !holes[i-2]) {
                    dp.add((dp.get(i-1) + dp.get(i-2)) % 1000000007);
                } else {
                    dp.add(dp.get(i-1));
                }
            }
        }
        System.out.println(dp.get(N-1));
    }
}
 import java.util.*; util.* java class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        int[] holeIndices = new int[M];

        for (int i=0; i<M; i++) {
            holeIndices[i] = sc.nextInt() - 1;
        }

        boolean[] holes = new boolean[N];
        for (int i=0; i<N; i++) {
            holes[i] = false;
        }
        for (int index : holeIndices) {
            holes[index] = true;
        }

        if (holes[0] && holes[1]) {
            System.out.println(0);
            return;
        }

        List<Integer> dp = new ArrayList<>();
        dp.add(1);
        if (!holes[0]) {
            dp.add(2);
        } else {
            dp.add(1);
        }

        for (int i=2; i<N; i++) {
            if (holes[i]) {
                if (holes[i-1]) {
                    System.out.println(0);
                    return;
                } else {
                    dp.add(dp.get(i-1));
                }
            } else {
                if (!holes[i-1] && !holes[i-2]) {
                    dp.add((dp.get(i-1) + dp.get(i-2)) % 1000000007);
                } else {
                    dp.add(dp.get(i-1));
                }
            }
        }
        System.out.println(dp.get(N-1));
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        int[] holeIndices = new int[M];

        for (int i=0; i<M; i++) {
            holeIndices[i] = sc.nextInt() - 1;
        }

        boolean[] holes = new boolean[N];
        for (int i=0; i<N; i++) {
            holes[i] = false;
        }
        for (int index : holeIndices) {
            holes[index] = true;
        }

        if (holes[0] && holes[1]) {
            System.out.println(0);
            return;
        }

        List<Integer> dp = new ArrayList<>();
        dp.add(1);
        if (!holes[0]) {
            dp.add(2);
        } else {
            dp.add(1);
        }

        for (int i=2; i<N; i++) {
            if (holes[i]) {
                if (holes[i-1]) {
                    System.out.println(0);
                    return;
                } else {
                    dp.add(dp.get(i-1));
                }
            } else {
                if (!holes[i-1] && !holes[i-2]) {
                    dp.add((dp.get(i-1) + dp.get(i-2)) % 1000000007);
                } else {
                    dp.add(dp.get(i-1));
                }
            }
        }
        System.out.println(dp.get(N-1));
    } main {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        int[] holeIndices = new int[M];

        for (int i=0; i<M; i++) {
            holeIndices[i] = sc.nextInt() - 1;
        }

        boolean[] holes = new boolean[N];
        for (int i=0; i<N; i++) {
            holes[i] = false;
        }
        for (int index : holeIndices) {
            holes[index] = true;
        }

        if (holes[0] && holes[1]) {
            System.out.println(0);
            return;
        }

        List<Integer> dp = new ArrayList<>();
        dp.add(1);
        if (!holes[0]) {
            dp.add(2);
        } else {
            dp.add(1);
        }

        for (int i=2; i<N; i++) {
            if (holes[i]) {
                if (holes[i-1]) {
                    System.out.println(0);
                    return;
                } else {
                    dp.add(dp.get(i-1));
                }
            } else {
                if (!holes[i-1] && !holes[i-2]) {
                    dp.add((dp.get(i-1) + dp.get(i-2)) % 1000000007);
                } else {
                    dp.add(dp.get(i-1));
                }
            }
        }
        System.out.println(dp.get(N-1));
    } 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[] holeIndices = new int[M]; holeIndices new int[M] M for (int i=0; i<M; i++) {
            holeIndices[i] = sc.nextInt() - 1;
        } int i=0; int i=0; i 0 i<M i M i++ i++ i {
            holeIndices[i] = sc.nextInt() - 1;
        } {
            holeIndices[i] = sc.nextInt() - 1;
        } holeIndices[i] = sc.nextInt() - 1 holeIndices[i] holeIndices i sc.nextInt() - 1 sc.nextInt() sc.nextInt sc 1 boolean[] holes = new boolean[N]; holes new boolean[N] N for (int i=0; i<N; i++) {
            holes[i] = false;
        } int i=0; int i=0; i 0 i<N i N i++ i++ i {
            holes[i] = false;
        } {
            holes[i] = false;
        } holes[i] = false holes[i] holes i false for (int index : holeIndices) {
            holes[index] = true;
        } int index holeIndices {
            holes[index] = true;
        } {
            holes[index] = true;
        } holes[index] = true holes[index] holes index true if (holes[0] && holes[1]) {
            System.out.println(0);
            return;
        } holes[0] && holes[1] holes[0] holes 0 holes[1] holes 1 {
            System.out.println(0);
            return;
        } System.out.println(0) System.out.println System.out System System.out 0 return; List<Integer> dp = new ArrayList<>(); dp new ArrayList<>() dp.add(1) dp.add dp 1 if (!holes[0]) {
            dp.add(2);
        } else {
            dp.add(1);
        } !holes[0] holes[0] holes 0 {
            dp.add(2);
        } dp.add(2) dp.add dp 2 {
            dp.add(1);
        } dp.add(1) dp.add dp 1 for (int i=2; i<N; i++) {
            if (holes[i]) {
                if (holes[i-1]) {
                    System.out.println(0);
                    return;
                } else {
                    dp.add(dp.get(i-1));
                }
            } else {
                if (!holes[i-1] && !holes[i-2]) {
                    dp.add((dp.get(i-1) + dp.get(i-2)) % 1000000007);
                } else {
                    dp.add(dp.get(i-1));
                }
            }
        } int i=2; int i=2; i 2 i<N i N i++ i++ i {
            if (holes[i]) {
                if (holes[i-1]) {
                    System.out.println(0);
                    return;
                } else {
                    dp.add(dp.get(i-1));
                }
            } else {
                if (!holes[i-1] && !holes[i-2]) {
                    dp.add((dp.get(i-1) + dp.get(i-2)) % 1000000007);
                } else {
                    dp.add(dp.get(i-1));
                }
            }
        } {
            if (holes[i]) {
                if (holes[i-1]) {
                    System.out.println(0);
                    return;
                } else {
                    dp.add(dp.get(i-1));
                }
            } else {
                if (!holes[i-1] && !holes[i-2]) {
                    dp.add((dp.get(i-1) + dp.get(i-2)) % 1000000007);
                } else {
                    dp.add(dp.get(i-1));
                }
            }
        } if (holes[i]) {
                if (holes[i-1]) {
                    System.out.println(0);
                    return;
                } else {
                    dp.add(dp.get(i-1));
                }
            } else {
                if (!holes[i-1] && !holes[i-2]) {
                    dp.add((dp.get(i-1) + dp.get(i-2)) % 1000000007);
                } else {
                    dp.add(dp.get(i-1));
                }
            } holes[i] holes i {
                if (holes[i-1]) {
                    System.out.println(0);
                    return;
                } else {
                    dp.add(dp.get(i-1));
                }
            } if (holes[i-1]) {
                    System.out.println(0);
                    return;
                } else {
                    dp.add(dp.get(i-1));
                } holes[i-1] holes i-1 i 1 {
                    System.out.println(0);
                    return;
                } System.out.println(0) System.out.println System.out System System.out 0 return; {
                    dp.add(dp.get(i-1));
                } dp.add(dp.get(i-1)) dp.add dp dp.get(i-1) dp.get dp i-1 i 1 {
                if (!holes[i-1] && !holes[i-2]) {
                    dp.add((dp.get(i-1) + dp.get(i-2)) % 1000000007);
                } else {
                    dp.add(dp.get(i-1));
                }
            } if (!holes[i-1] && !holes[i-2]) {
                    dp.add((dp.get(i-1) + dp.get(i-2)) % 1000000007);
                } else {
                    dp.add(dp.get(i-1));
                } !holes[i-1] && !holes[i-2] !holes[i-1] holes[i-1] holes i-1 i 1 !holes[i-2] holes[i-2] holes i-2 i 2 {
                    dp.add((dp.get(i-1) + dp.get(i-2)) % 1000000007);
                } dp.add((dp.get(i-1) + dp.get(i-2)) % 1000000007) dp.add dp (dp.get(i-1) + dp.get(i-2)) % 1000000007 (dp.get(i-1) + dp.get(i-2)) dp.get(i-1) dp.get dp i-1 i 1 dp.get(i-2) dp.get dp i-2 i 2 1000000007 {
                    dp.add(dp.get(i-1));
                } dp.add(dp.get(i-1)) dp.add dp dp.get(i-1) dp.get dp i-1 i 1 System.out.println(dp.get(N-1)) System.out.println System.out System System.out dp.get(N-1) dp.get dp N-1 N 1 String[] args args
import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        int[] holeIndices = new int[M];

        for (int i=0; i<M; i++) {
            holeIndices[i] = sc.nextInt() - 1;
        }

        boolean[] holes = new boolean[N];
        for (int i=0; i<N; i++) {
            holes[i] = false;
        }
        for (int index : holeIndices) {
            holes[index] = true;
        }

        if (holes[0] && holes[1]) {
            System.out.println(0);
            return;
        }

        List<Integer> dp = new ArrayList<>();
        dp.add(1);
        if (!holes[0]) {
            dp.add(2);
        } else {
            dp.add(1);
        }

        for (int i=2; i<N; i++) {
            if (holes[i]) {
                if (holes[i-1]) {
                    System.out.println(0);
                    return;
                } else {
                    dp.add(dp.get(i-1));
                }
            } else {
                if (!holes[i-1] && !holes[i-2]) {
                    dp.add((dp.get(i-1) + dp.get(i-2)) % 1000000007);
                } else {
                    dp.add(dp.get(i-1));
                }
            }
        }
        System.out.println(dp.get(N-1));
    }
}

