#include <bits/stdc++.h>
using namespace std;
void read(int &x) {
  char ch = getchar();
  while (ch < '0' || ch > '9') ch = getchar();
  for (x = 0; ch >= '0' && ch <= '9'; ch = getchar()) x = x * 10 + ch - 48;
}
int P(1000000007);
int n, m, a[110][110000], C[110000][110];
int main() {
  read(n), read(m);
  for (int i = 1; i <= (n); ++i) read(a[0][i]);
  C[0][0] = 1;
  for (int i = 1; i <= (100200); ++i) {
    C[i][0] = 1;
    for (int j = 1; j <= (102); ++j)
      C[i][j] = (C[i - 1][j - 1] + C[i - 1][j]) % P;
  }
  while (m--) {
    int l, r, k;
    read(l), read(r), read(k);
    a[k + 1][l] = (a[k + 1][l] + 1) % P;
    for (int i = 1; i <= (k + 1); ++i)
      a[i][r + 1] = (a[i][r + 1] - C[r - l + k + 1 - i][k + 1 - i] + P) % P;
  }
  for (int i = (101); i >= (0); --i) {
    int t(0);
    for (int j = 1; j <= (n); ++j) {
      t = (t + a[i + 1][j]) % P;
      a[i][j] = (a[i][j] + t) % P;
    }
  }
  for (int i = 1; i <= (n - 1); ++i) printf("%d ", a[0][i]);
  printf("%d\n", a[0][n]);
  return 0;
}
