Below is my code :

int MOD=1000000007;

public int solve(int A, int B) {

int dp[][] = new int[A+1][B+1];

```
for(int i=0;i<=A;i++)
Arrays.fill(dp[i],0);
for(int i=1;i<=A;i++){
for(int j=1;j<=B;j++){
if(i==1) dp[i][j]=1;
else{
dp[i][j]= (dp[i-1][j]%MOD+dp[i][j-1]%MOD)%MOD;
}
}
}
return dp[A][B];
}
```