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 maxN = 3e5 + 7, MOD = 1e9 + 9, INF = 1e9 + 7, N = 1e6 + 17,
                sqr = 383008016;
long long sum[maxN][3], helper[4 * maxN][3], p[maxN][3], u, v, rev_sqr, rev_two,
    type, a[maxN], dp[maxN], ar[4 * maxN][3];
inline int left(int x) { return 2 * x + 1; }
inline int right(int x) { return 2 * x + 2; }
void shift(int node, int st, int en, int type) {
  if (en - st < 2 || !helper[node][type]) return;
  int mid = (st + en) >> 1;
  helper[left(node)][type] += helper[node][type],
      helper[left(node)][type] %= MOD;
  helper[right(node)][type] += (helper[node][type] * p[mid - st][type]) % MOD,
      helper[right(node)][type] %= MOD;
  ar[left(node)][type] += (helper[node][type] * sum[mid - st - 1][type]) % MOD,
      ar[left(node)][type] %= MOD;
  ar[right(node)][type] += (((helper[node][type] * p[mid - st][type]) % MOD) *
                            sum[en - mid - 1][type]) %
                           MOD,
      ar[right(node)][type] %= MOD;
  helper[node][type] = 0;
}
void add(int node, int st, int en, int l, int r, int type) {
  if (en <= l || r <= st) return;
  if (st >= l && en <= r) {
    ar[node][type] += (p[st - l + 1][type] * sum[en - st - 1][type]) % MOD;
    helper[node][type] += p[st - l + 1][type], helper[node][type] %= MOD;
    return;
  }
  shift(node, st, en, type);
  int mid = (st + en) >> 1;
  add(left(node), st, mid, l, r, type);
  add(right(node), mid, en, l, r, type);
  ar[node][type] = ar[left(node)][type] + ar[right(node)][type];
  ar[node][type] %= MOD;
}
long long get(int node, int st, int en, int l, int r, int type) {
  if (en <= l || r <= st) return 0;
  if (st >= l && en <= r) return ar[node][type];
  int mid = (st + en) >> 1;
  shift(node, st, en, type);
  return (get(left(node), st, mid, l, r, type) +
          get(right(node), mid, en, l, r, type)) %
         MOD;
}
long long power(long long x, long long y) {
  if (y == 1) return x;
  if (!y) return 1;
  long long help = power(x, y >> 1);
  help *= help;
  help %= MOD;
  if (y & 1) help *= x;
  help %= MOD;
  return help;
}
inline long long modi(long long x) {
  x += 2 * MOD;
  return x % MOD;
}
void begin() {
  rev_two = power(2, MOD - 2);
  rev_sqr = power(5, MOD - 2) * sqr;
  rev_sqr %= MOD;
  u = 1 + sqr;
  u %= MOD;
  u *= rev_two;
  u %= MOD;
  v = 1 - sqr;
  v = modi(v);
  v *= rev_two;
  v %= MOD;
  p[0][1] = p[0][2] = sum[0][1] = sum[0][2] = 1;
  for (long long i = 1; i <= 300000; i++)
    p[i][1] = u * p[i - 1][1], p[i][1] %= MOD, p[i][2] = p[i - 1][2] * v,
    p[i][2] %= MOD, sum[i][1] = sum[i - 1][1] + p[i][1], sum[i][1] %= MOD,
    sum[i][2] = sum[i - 1][2] + p[i][2], sum[i][2] %= MOD;
}
long long l, r, n, q, res;
int main() {
  cin.tie(0), cout.tie(0), ios::sync_with_stdio(false);
  begin();
  cin >> n >> q;
  for (long long i = 1; i <= n; i++)
    cin >> a[i], dp[i] = dp[i - 1] + a[i], dp[i] %= MOD;
  while (q--) {
    cin >> type >> l >> r;
    l--;
    if (type == 1) {
      add(0, 0, n, l, r, 1);
      add(0, 0, n, l, r, 2);
    } else {
      res = dp[r] - dp[l];
      if (res < 0) res += MOD;
      res %= MOD;
      res += (modi((get(0, 0, n, l, r, 1) - get(0, 0, n, l, r, 2))) * rev_sqr) %
             MOD;
      res %= MOD;
      cout << res << '\n';
    }
  }
  return cout << "\n", 0;
}
