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 int N = 300005, p = 1e9 + 9;
int n, m;
long long fib[N << 1];
struct node {
  long long a, b, v;
} tr[N << 2];
inline int read() {
  int s = 0, w = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') w = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    s = s * 10 + ch - '0';
    ch = getchar();
  }
  return s * w;
}
inline void init() {
  fib[1] = 1;
  for (int i = 2; i < (N << 1) - 1; ++i) fib[i] = (fib[i - 1] + fib[i - 2]) % p;
}
inline void update(int k) { tr[k].v = (tr[k << 1].v + tr[k << 1 | 1].v) % p; }
inline void chenge(int k, int l, int r, int a, int b) {
  tr[k].a = (tr[k].a + a) % p;
  tr[k].b = (tr[k].b + b) % p;
  tr[k].v = (((tr[k].v + (long long)a * fib[r - l + 1] % p) % p +
              (long long)b * fib[r - l + 2] % p) %
                 p -
             b + p) %
            p;
}
inline void down(int k, int l, int r) {
  int mia, mib;
  mia = (tr[k].a * fib[((l + r) >> 1) - l] % p +
         tr[k].b * fib[((l + r) >> 1) - l + 1] % p) %
        p;
  mib = (tr[k].a * fib[((l + r) >> 1) - l + 1] % p +
         tr[k].b * fib[((l + r) >> 1) - l + 2] % p) %
        p;
  chenge(k << 1, l, ((l + r) >> 1), tr[k].a, tr[k].b);
  chenge(k << 1 | 1, ((l + r) >> 1) + 1, r, mia, mib);
  tr[k].a = tr[k].b = 0;
}
void build(int k, int l, int r) {
  if (l == r) {
    tr[k].v = read();
    return;
  }
  build(k << 1, l, ((l + r) >> 1));
  build(k << 1 | 1, ((l + r) >> 1) + 1, r);
  update(k);
}
void change(int k, int l, int r, int x, int y) {
  if (x <= l && y >= r) {
    chenge(k, l, r, fib[l - x + 1], fib[l - x + 2]);
    return;
  }
  if (tr[k].a) down(k, l, r);
  if (x <= ((l + r) >> 1)) change(k << 1, l, ((l + r) >> 1), x, y);
  if (y > ((l + r) >> 1)) change(k << 1 | 1, ((l + r) >> 1) + 1, r, x, y);
  update(k);
}
int ask(int k, int l, int r, int x, int y) {
  if (l == x && y == r) {
    return tr[k].v % p;
  }
  if (tr[k].a) down(k, l, r);
  if (y <= ((l + r) >> 1))
    return ask(k << 1, l, ((l + r) >> 1), x, y) % p;
  else if (x > ((l + r) >> 1))
    return ask(k << 1 | 1, ((l + r) >> 1) + 1, r, x, y) % p;
  else
    return (ask(k << 1, l, ((l + r) >> 1), x, ((l + r) >> 1)) +
            ask(k << 1 | 1, ((l + r) >> 1) + 1, r, ((l + r) >> 1) + 1, y)) %
           p;
}
int main() {
  n = read();
  m = read();
  init();
  build(1, 1, n);
  int opt, x, y;
  while (m--) {
    opt = read();
    x = read();
    y = read();
    if (opt == 2)
      printf("%d\n", ask(1, 1, n, x, y) % p);
    else
      change(1, 1, n, x, y);
  }
  fclose(stdin);
  fclose(stdout);
  return 0;
}
