#include <bits/stdc++.h>
using namespace std;
const int MAXSIZE = 10000020;
const int mod = 1000000007;
int bufpos;
char buf[MAXSIZE];
void init() {
  buf[fread(buf, 1, MAXSIZE, stdin)] = '\0';
  bufpos = 0;
}
int readint() {
  int val = 0;
  for (; !isdigit(buf[bufpos]); bufpos++)
    ;
  for (; isdigit(buf[bufpos]); bufpos++) val = val * 10 + buf[bufpos] - '0';
  return val;
}
char readchar() {
  for (; isspace(buf[bufpos]); bufpos++)
    ;
  return buf[bufpos++];
}
int readstr(char* s) {
  int cur = 0;
  for (; isspace(buf[bufpos]); bufpos++)
    ;
  for (; !isspace(buf[bufpos]); bufpos++) s[cur++] = buf[bufpos];
  s[cur] = '\0';
  return cur;
}
int a[103][100003], c[100103][103];
int main() {
  init();
  int n = readint(), m = readint();
  for (int i = 1; i <= n; i++) a[0][i] = readint();
  c[0][0] = 1;
  for (int i = 1; i <= n + 101; i++) {
    c[i][0] = 1;
    for (int j = 1; j <= 101; j++)
      c[i][j] = (c[i - 1][j] + c[i - 1][j - 1]) % mod;
  }
  while (m--) {
    int l = readint(), r = readint(), k = readint();
    (++a[k + 1][l]) %= mod;
    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]) % mod;
  }
  for (int i = 101; i; i--)
    for (int j = 1; j <= n; j++) {
      a[i][j] = (a[i][j] + a[i][j - 1]) % mod;
      a[i - 1][j] = (a[i - 1][j] + a[i][j]) % mod;
    }
  for (int i = 1; i <= n; i++) printf("%d\n", (a[0][i] + mod) % mod);
}
