Language: C++

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[] a=new int[m];
		for(int i=0;i<m;i++){
			a[i]=sc.nextInt();
		}

		int r=1_000_000_007;
		int[] d=new int[n+1];
		d[0]=1;
		d[1]=1;
		for(int i=0;i<n+1;i++){
			boolean boo=true;
			for(int j=0;j<m;j++){
				if(i==a[j])
				boo=false;
			}
			if(i>1){
			if(boo==true)
			d[i]=d[i-1]+d[i-2];
			else
			d[i]=0;
			}
		}
		System.out.println(d[n]%r);
		
	}
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:15: error: expected ':' before 'static'
    3 |         public static void main(String[] args){
      |               ^~~~~~~
      |               :
a.cc:3:33: error: 'String' has not been declared
    3 |         public static void main(String[] args){
      |                                 ^~~~~~
a.cc:3:42: error: expected ',' or '...' before 'args'
    3 |         public static void main(String[] args){
      |                                          ^~~~
a.cc:32:2: error: expected ';' after class definition
   32 | }
      |  ^
      |  ;
a.cc: In static member function 'static void Main::main(int*)':
a.cc:4:17: error: 'Scanner' was not declared in this scope
    4 |                 Scanner sc=new Scanner(System.in);
      |                 ^~~~~~~
a.cc:5:23: error: 'sc' was not declared in this scope
    5 |                 int n=sc.nextInt();
      |                       ^~
a.cc:7:20: error: structured binding declaration cannot have type 'int'
    7 |                 int[] a=new int[m];
      |                    ^~
a.cc:7:20: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:7:20: error: empty structured binding declaration
a.cc:7:23: error: expected initializer before 'a'
    7 |                 int[] a=new int[m];
      |                       ^
a.cc:9:25: error: 'a' was not declared in this scope
    9 |                         a[i]=sc.nextInt();
      |                         ^
a.cc:12:23: error: unable to find numeric literal operator 'operator""_000_000_007'
   12 |                 int r=1_000_000_007;
      |                       ^~~~~~~~~~~~~
a.cc:13:20: error: structured binding declaration cannot have type 'int'
   13 |                 int[] d=new int[n+1];
      |                    ^~
a.cc:13:20: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:13:20: error: empty structured binding declaration
a.cc:13:23: error: expected initializer before 'd'
   13 |                 int[] d=new int[n+1];
      |                       ^
a.cc:14:17: error: 'd' was not declared in this scope
   14 |                 d[0]=1;
      |                 ^
a.cc:17:25: error: 'boolean' was not declared in this scope; did you mean 'bool'?
   17 |                         boolean boo=true;
      |                         ^~~~~~~
      |                         bool
a.cc:19:39: error: 'a' was not declared in this scope
   19 |                                 if(i==a[j])
      |                                       ^
a.cc:20:33: error: 'boo' was not declared in this scope; did you mean 'bool'?
   20 |                                 boo=false;
      |                                 ^~~
      |                                 bool
a.cc:23:28: error: 'boo' was not declared in this scope; did you mean 'bool'?
   23 |                         if(boo==true)
      |                            ^~~
      |                            bool
a.cc:29:17: error: 'System' was not declared in this scope
   29 |                 System.out.println(d[n]%r);
      |                 ^~~~~~