Why is mod used here?

Why is mod used for the dice combinations solution?
dp[i] %= 1000000007;