#include <bits/stdc++.h>
using namespace std;
const int M = 100000 + 100;
const int N = 100 + 100;
const int Mod = 1000000007;
int n, m;
int C[M][N], B[M][N], A[M];
int cnt[N];
inline void Pre() {
  C[0][0] = 1;
  for (int i = 1; i <= 100000; ++i) {
    C[i][0] = 1;
    for (int j = 1; j <= 100; ++j)
      C[i][j] = (C[i - 1][j] + C[i - 1][j - 1]) % Mod;
  }
}
int main() {
  Pre();
  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) B[L][j] = (B[L][j] + C[k][k - j]) % Mod;
    for (int j = 0; j <= k; ++j)
      B[R + 1][j] = (B[R + 1][j] - C[R + 1 - L + k][k - j]) % Mod;
  }
  for (int i = 1; i <= n; ++i) {
    for (int j = 0; j <= 100; ++j) cnt[j] = (cnt[j] + B[i][j]) % Mod;
    A[i] = (A[i] + cnt[0]) % Mod;
    for (int j = 0; j <= 100; ++j) cnt[j] = (cnt[j] + cnt[j + 1]) % Mod;
  }
  for (int i = 1; i <= n; ++i) printf("%d ", (A[i] + Mod) % Mod);
  return 0;
}
