Implement a function named count_possible_strings that calculates the number of possible strings that can be formed given an integer n. The function should utilize modular arithmetic to ensure the result remains within manageable limits.
Function Signature
python
def count_possible_strings(n: int) -> int:
Functionality Requirements
The function should compute the following expression:
[
\text{result} = (1 + n \times 2 + n \times \frac{(n^2 - 1)}{2}) \mod (10^9 + 7)
]
It should return the computed result as an integer.
Input Requirements
The function takes a single argument:
n: An integer (0 ≤ n ≤ 10^6).
Output Requirements
The function should return an integer representing the number of possible strings.
File Requirement
The solution must be implemented in a file named /app/solution.py.