#include using namespace std; long sam(int n) { long s=0; for(;n>=1;n--) s+=n; return s; } int solve(vector A) { int n=A.size(); long m=sam(A.size()); vector B(m); long f=0; for(long k=0;k1000000007) f-=1000000007; } } return f; // Return the length of the longest possible sequence of moves modulo 10^9+7. } int main() { unsigned int n; cin >> n; vector a(n); for(int a_i = 0; a_i < n; a_i++){ cin >> a[a_i]; } int result = solve(a); cout << result << endl; return 0; }