Language: C++

#pragma GCC optimize "-O3"
#pragma GCC target ("avx")
#define _USE_MATH_DEFINES
#include<bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;++i)
#define vi vector<int>
#define vvi vector<vi>
#define pb push_back
#define pi pair<int,int>
#define vp vector<pair<int,int>>
#define mp make_pair
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
#define MEMSET(a) memset(a,0,sizeof(a))
#define inf (1ll<<60)
#define SORT(v) sort(all(v))
#define RSORT(v) sort(all(v),greater<int>())
signed gcd(int a, int b){return b?gcd(b,a%b):a;}
signed lcm(int a, int b){return a*b/gcd(a,b);}

using namespace std;

const int mod=1e9+7;

void run();
signed tansaku(int now);

void init() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout<<fixed<<setprecision(12);
}

signed main(){
    init();
    run();
    return 0;
}

int ans=0;
vi a(1);
int n,m;
void run(){
    cin >> n >> m;
    a.resize(m,0);
    rep(i,m)
    {
        int d;
        cin >> d;
        a[d-1]=1;
    }
    tansaku(0);
    ans%=mod;
    cout << ans <<endl;
}

signed tansaku(int now){
    if(a[now]==1)return 0;
    if(now>=n-1)
    {
        ans++;
        return 0;
    }
    tansaku(now+1);
    tansaku(now+2);
}


#pragma GCC optimize "-O3"
#pragma GCC target ("avx")
#define _USE_MATH_DEFINES
#include<bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;++i)
#define vi vector<int>
#define vvi vector<vi>
#define pb push_back
#define pi pair<int,int>
#define vp vector<pair<int,int>>
#define mp make_pair
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
#define MEMSET(a) memset(a,0,sizeof(a))
#define inf (1ll<<60)
#define SORT(v) sort(all(v))
#define RSORT(v) sort(all(v),greater<int>())
signed gcd(int a, int b){return b?gcd(b,a%b):a;}
signed lcm(int a, int b){return a*b/gcd(a,b);}

using namespace std;

const int mod=1e9+7;

void run();
signed tansaku(int now);

void init() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout<<fixed<<setprecision(12);
}

signed main(){
    init();
    run();
    return 0;
}

int ans=0;
vi a(1);
int n,m;
void run(){
    cin >> n >> m;
    a.resize(m,0);
    rep(i,m)
    {
        int d;
        cin >> d;
        a[d-1]=1;
    }
    tansaku(0);
    ans%=mod;
    cout << ans <<endl;
}

signed tansaku(int now){
    if(a[now]==1)return 0;
    if(now>=n-1)
    {
        ans++;
        return 0;
    }
    tansaku(now+1);
    tansaku(now+2);
}




Compiler output:
a.cc:95:11: error: redefinition of 'const long long int mod'
   95 | const int mod=1e9+7;
      |           ^~~
a.cc:25:11: note: 'const long long int mod' previously defined here
   25 | const int mod=1e9+7;
      |           ^~~
a.cc:106:8: error: redefinition of 'int main()'
  106 | signed main(){
      |        ^~~~
a.cc:36:8: note: 'int main()' previously defined here
   36 | signed main(){
      |        ^~~~
a.cc:112:5: error: redefinition of 'long long int ans'
  112 | int ans=0;
      |     ^~~
a.cc:42:5: note: 'long long int ans' previously defined here
   42 | int ans=0;
      |     ^~~
a.cc:113:4: error: redefinition of 'std::vector<long long int> a'
  113 | vi a(1);
      |    ^
a.cc:43:4: note: 'std::vector<long long int> a' previously declared here
   43 | vi a(1);
      |    ^
a.cc:114:5: error: redefinition of 'long long int n'
  114 | int n,m;
      |     ^
a.cc:44:5: note: 'long long int n' previously declared here
   44 | int n,m;
      |     ^
a.cc:114:7: error: redefinition of 'long long int m'
  114 | int n,m;
      |       ^
a.cc:44:7: note: 'long long int m' previously declared here
   44 | int n,m;
      |       ^
a.cc: In function 'int tansaku(long long int)':
a.cc:67:12: warning: control reaches end of non-void function [-Wreturn-type]
   67 |     tansaku(now+2);
      |     ~~~~~~~^~~~~~~
a.cc: In function 'int tansaku(long long int)':
a.cc:137:12: warning: control reaches end of non-void function [-Wreturn-type]
  137 |     tansaku(now+2);
      |     ~~~~~~~^~~~~~~