#include <bits/stdc++.h>   const int mod = 1000000007, maxn = 200005, maxk = 105;   int n, m;   int a[maxn], fac[maxn], nfac[maxn], inv[maxn], sum[maxn][maxk];   inline int C(int a, int b) {     return 1ll * fac[a] * nfac[b] % mod * nfac[a - b] % mod;   }   int main() {     fac[0] = fac[1] = nfac[0] = nfac[1] = inv[1] = 1;     for (int i = 2; i <= 200000; i++)       fac[i] = 1ll * fac[i - 1] * i % mod,       inv[i] = mod - 1ll * (mod / i) * inv[mod % i] % mod,       nfac[i] = 1ll * nfac[i - 1] * inv[i] % mod;     scanf( %d%d , &n, &m);     for (int i = 1; i <= n; i++) scanf( %d , &a[i]);     for (int i = 1; i <= m; i++) {       int l, r, k;       scanf( %d%d%d , &l, &r, &k);       for (int j = 0; j <= k; j++) {         sum[l][j] = (sum[l][j] + C(k, k - j)) % mod;         sum[r + 1][j] = (sum[r + 1][j] - C(k + r - l + 1, k - j) + mod) % mod;       }     }     for (int i = 1; i <= n; i++)       for (int j = 100; j >= 0; j--)         sum[i][j] = (sum[i][j] + (sum[i - 1][j + 1] + sum[i - 1][j]) % mod) % mod;     for (int i = 1; i <= n; i++)       printf( %d%c , (a[i] + sum[i][0]) % mod, i == n ?   n  :    );     return 0;   }   