In mathematical terms, the sequence Fn of Fibonacci numbers is defined by the recurrence relation 

F1 = 1; F2 = 1; Fn = Fn - 1 + Fn - 2 (n > 2).

DZY loves Fibonacci numbers very much. Today DZY gives you an array consisting of n integers: a1, a2, ..., an. Moreover, there are m queries, each query has one of the two types:

  1. Format of the query "1 l r". In reply to the query, you need to add Fi - l + 1 to each element ai, where l ≤ i ≤ r. 
  2. Format of the query "2 l r". In reply to the query you should output the value of <image> modulo 1000000009 (109 + 9). 



Help DZY reply to all the queries.

Input

The first line of the input contains two integers n and m (1 ≤ n, m ≤ 300000). The second line contains n integers a1, a2, ..., an (1 ≤ ai ≤ 109) — initial array a.

Then, m lines follow. A single line describes a single query in the format given in the statement. It is guaranteed that for each query inequality 1 ≤ l ≤ r ≤ n holds.

Output

For each query of the second type, print the value of the sum on a single line.

Examples

Input

4 4
1 2 3 4
1 1 4
2 1 4
1 2 4
2 1 3


Output

17
12

Note

After the first query, a = [2, 3, 5, 7].

For the second query, sum = 2 + 3 + 5 + 7 = 17.

After the third query, a = [2, 4, 6, 9].

For the fourth query, sum = 2 + 4 + 6 = 12.
#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 9, sq5 = 616991993, inv2 = 500000005,
                invsq5 = 723398404;
const long long bases[2] = {(1 + sq5) * inv2 % mod,
                            (mod + 1 - sq5) * inv2 % mod};
long long powers[2][400001], ipowers[2][400001];
long long power(long long base, long long expo) {
  long long ans = 1;
  while (expo) {
    if (expo & 1) ans = (ans * base) % mod;
    base = (base * base) % mod;
    expo >>= 1;
  }
  return ans;
}
long long powerz(long long base, long long expo) {
  if (base == bases[0]) return powers[0][expo];
  return powers[1][expo];
}
long long ipowerz(long long base, long long expo) {
  if (base == bases[0]) return ipowers[0][expo];
  return ipowers[1][expo];
}
long long san(long long base, long long l, long long r, long long n) {
  long long ans = powerz(base, l) * (powerz(base, r - l + 1) - 1) % mod *
                  ipowerz(base, n) % mod;
  return ans;
}
long long segtree[2][1200000], lazy[2][1200000];
inline void lazy_update(const long long &f, const long long &loc,
                        const long long &l, const long long &r) {
  if (lazy[f][loc]) {
    segtree[f][loc] = (segtree[f][loc] + lazy[f][loc]);
    if (segtree[f][loc] >= mod) segtree[f][loc] -= mod;
    if (l != r) {
      long long mid = (l + r) >> 1;
      lazy[f][2 * loc] = (lazy[f][2 * loc] +
                          san(bases[f], 0, mid - l, r - l + 1) * lazy[f][loc]) %
                         mod;
      lazy[f][2 * loc + 1] =
          (lazy[f][2 * loc + 1] +
           san(bases[f], mid - l + 1, r - l, r - l + 1) * lazy[f][loc]) %
          mod;
    }
    lazy[f][loc] = 0;
  }
}
void update(const long long &f, const long long &loc, const long long &st,
            const long long &en, const long long &l, const long long &r,
            const long long &val) {
  lazy_update(f, loc, l, r);
  if (l >= st && r <= en) {
    lazy[f][loc] = (lazy[f][loc] + val);
    if (lazy[f][loc] >= mod) lazy[f][loc] -= mod;
    lazy_update(f, loc, l, r);
    return;
  }
  long long mid = (l + r) >> 1;
  if (mid >= en) {
    update(f, 2 * loc, st, en, l, mid, val);
  } else if (mid < st) {
    update(f, 2 * loc + 1, st, en, mid + 1, r, val);
  } else {
    long long p1 = san(bases[f], 0, mid - st, en - st + 1) * val % mod;
    long long p2 =
        san(bases[f], mid - st + 1, en - st, en - st + 1) * val % mod;
    update(f, 2 * loc, st, mid, l, mid, p1);
    update(f, 2 * loc + 1, mid + 1, en, mid + 1, r, p2);
  }
  segtree[f][loc] = (segtree[f][loc] + val);
  if (segtree[f][loc] >= mod) segtree[f][loc] -= mod;
}
long long query(const long long &f, const long long &loc, const long long &st,
                const long long &en, const long long &l, const long long &r) {
  lazy_update(f, loc, l, r);
  if (en < l || st > r) return 0;
  if (l >= st && r <= en) return segtree[f][loc];
  long long mid = (l + r) >> 1;
  long long ans = query(f, 2 * loc, st, en, l, mid) +
                  query(f, 2 * loc + 1, st, en, mid + 1, r);
  if (ans >= mod) ans -= mod;
  return ans;
}
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long n, m, x, l, r;
  cin >> n >> m;
  powers[0][0] = powers[1][0] = 1;
  for (long long i = 1; i <= 400000; i++) {
    powers[0][i] = (powers[0][i - 1] * bases[0]) % mod;
    powers[1][i] = (powers[1][i - 1] * bases[1]) % mod;
    ipowers[0][i] = power(powers[0][i] - 1, mod - 2);
    ipowers[1][i] = power(powers[1][i] - 1, mod - 2);
  }
  vector<long long> pre(n + 1);
  for (long long i = 1; i <= n; i++) {
    cin >> pre[i];
    pre[i] = (pre[i - 1] + pre[i]);
    if (pre[i] >= mod) pre[i] -= mod;
  }
  while (m--) {
    cin >> x >> l >> r;
    if (x == 1) {
      long long val =
          bases[0] * (powers[0][r - l + 1] - 1) % mod * ipowers[0][1] % mod;
      update(0, 1, l, r, 1, n, val);
      val = bases[1] * (powers[1][r - l + 1] - 1) % mod * ipowers[1][1] % mod;
      update(1, 1, l, r, 1, n, val);
    } else {
      long long ans =
          (mod + query(0, 1, l, r, 1, n) - query(1, 1, l, r, 1, n)) * invsq5 %
          mod;
      ans = (mod + ans + pre[r] - pre[l - 1]) % mod;
      cout << ans << endl;
    }
  }
  return 0;
}
