I am submitting the code on codechef but error message is generating saying wrong answer

#include<bits/stdc++.h>
using namespace std;
#define MOD 1000000007
int dp[1001][1001];
int path(int row,int col){
if(dp[0][0]==-1){
return 0;
}

for(int i=0;i<row;i++){
    if(dp[0][i]==-1){
        break;
    }
    dp[0][i] = 1;
}
for(int i=0;i<col;i++){
    if(dp[i][0]==-1){
        break;
    }
    dp[i][0]=1;
}

for(int i=1;i<row;i++){
    for(int j=1;j<col;j++){
        if(dp[i][j]==-1){
            continue;
        }
        dp[i][j]=0;
        if(dp[i][j-1]!=-1){
            dp[i][j]=dp[i][j-1]%MOD;
        }
        if(dp[i-1][j]!=-1){
            dp[i][j]=(dp[i][j]+dp[i-1][j])%MOD;
        }
    }
}
  if(dp[row-1][col-1]==-1){
    return 0;
}
return dp[row-1][col-1];

}
int main(){
int row,col,blocked;
cin>>row>>col>>blocked;
int m,n;
memset(dp,0,sizeof(dp));
for(int i=0;i<blocked;i++){

    cin>>m>>n;
    dp[m-1][n-1]=-1;

}

cout<<path(row,col);
}

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.