You are given a string word. Count the number of subsequences of word such that every character that appears in the subsequence appears the same number of times. Return this count modulo 10^9 + 7.
word: a string made up of lowercase English letters. Its length is at most 1000.10^9 + 7.Input: word = "aaa"
Output: 8
Because "aaa" uses only the letter 'a', every subsequence has all of its characters occurring the same number of times. The subsequences are the empty string, three single-letter subsequences, three two-letter subsequences, and "aaa", for a total of 8.