#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
const int INF = 0x3f3f3f3f, N = 1e5 + 5;
constexpr ll mod = 1e9 + 7;
ll a[N], d[N][105], c[N][105];
void init() {
  for (int i = 0; i < N; i++) c[i][0] = 1;
  for (int i = 1; i < N; i++) {
    for (int j = 1; j < 105; j++) {
      c[i][j] = (c[i - 1][j] + c[i - 1][j - 1]) % mod;
    }
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  init();
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i <= m; i++) {
    int l, r, k;
    cin >> l >> r >> k;
    d[l][k] = (d[l][k] + 1) % mod;
    for (int i = k; i >= 0; i--)
      d[r + 1][i] = (d[r + 1][i] - c[k - i + r - l][k - i] + mod) % mod;
  }
  for (int i = 100; i >= 0; i--)
    for (int j = 1; j <= n; j++)
      d[j][i] = (d[j][i] + d[j - 1][i] + d[j][i + 1]) % mod;
  for (int i = 1; i <= n; i++) cout << (d[i][0] + a[i]) % mod << ' ';
  return 0;
}
