Value of output changes when MOD value = 1e9 +7 is declared outside ftn and when its declared inside ftn

class solution {
private: int MOD= 1e9 + 7;

public:

int countOrders (int n) {

long places_ketna_hai_baaki =2*n;

long seq = 1;

for(int i=n; i>=2; iā€“)

{

seq* =(places_ketna_hai_baaki* (places_ketna_hai_baaki - 1))/2; seq=seq%MOD;

places_ketna_hai_baaki = places_ketna_hai_baaki 2;

}

return (int)seq;
}
};

Here when I initialize MOD value inside ftm then ans is not coming wheras on declaring it outside it wirks why? As we are using the value inside ftn only