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.
import java.io.OutputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author George Marcus
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskC solver = new TaskC();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskC {
    private static final int MOD = 1000000009;
    int[] A;
    int[] Aint;
    int[] A1;
    int[] A2;
    int a;
    int b;
    int[][][] fib;
    int[][][] sumFib;

    public void solve(int testNumber, InputReader in, PrintWriter out) {
        int N = in.nextInt();
        int M = in.nextInt();
        A = new int[N];
        for (int i = 0; i < N; i++) {
            A[i] = in.nextInt();
        }

        Aint = new int[4 * N];
        A1 = new int[4 * N];
        A2 = new int[4 * N];
        init(1, 0, N - 1);

        int[][] mat = new int[][]{
                { 0, 1 },
                { 1, 1 }
        };
        fib = new int[N][2][2];
        sumFib = new int[N][2][2];
        fib[0] = new int[][]{
                { 1, 0 },
                { 0, 1 }
        };
        sumFib[0] = fib[0];

        for (int p = 1; p < N; p++) {
            for (int i = 0; i < 2; i++) {
                for (int j = 0; j < 2; j++) {
                    for (int k = 0; k < 2; k++) {
                        fib[p][i][j] = (int) ((fib[p][i][j] + (long)fib[p - 1][i][k] * mat[k][j]) % MOD);
                    }
                }
            }
            for (int i = 0; i < 2; i++) {
                for (int j = 0; j < 2; j++) {
                    sumFib[p][i][j] = sumFib[p - 1][i][j] + fib[p][i][j];
                    if (sumFib[p][i][j] >= MOD) {
                        sumFib[p][i][j] -= MOD;
                    }
                }
            }
        }

        for (int i = 0; i < M; i++) {
            int t = in.nextInt();
            a = in.nextInt() - 1;
            b = in.nextInt() - 1;
            if (t == 1) {
                update(1, 0, N - 1);
            }
            else {
                int q = query(1, 0, N - 1);
                out.println(q);
            }
        }
    }

    private int query(int k, int st, int dr) {
        if (a <= st && dr <= b) {
            return Aint[k];
        }

        push(k, st, dr);

        int m = (st + dr) / 2;
        int ret = 0;
        if (a <= m) {
            ret += query(2 * k, st, m);
            if (ret >= MOD) {
                ret -= MOD;
            }
        }
        if (b > m) {
            ret += query(2 * k + 1, m + 1, dr);
            if (ret >= MOD) {
                ret -= MOD;
            }
        }

        return ret;
    }

    private void update(int k, int st, int dr) {
        if (a <= st && dr <= b) {
            Aint[k] += getSum(1, 1, st - a, dr - a);
            if (Aint[k] >= MOD) {
                Aint[k] -= MOD;
            }
            A1[k] += getElem(1, 1, st - a);
            if (A1[k] >= MOD) {
                A1[k] -= MOD;
            }
            if (st < dr) {
                A2[k] += getElem(1, 1, st - a + 1);
                if (A2[k] >= MOD) {
                    A2[k] -= MOD;
                }
            }
            return;
        }

        push(k, st, dr);

        int m = (st + dr) / 2;
        if (a <= m) {
            update(2 * k, st, m);
        }
        if (m < b) {
            update(2 * k + 1, m + 1, dr);
        }

        Aint[k] = Aint[2 * k] + Aint[2 * k + 1];
        if (Aint[k] >= MOD) {
            Aint[k] -= MOD;
        }
    }

    // st < dr
    private void push(int k, int st, int dr) {
        int m = (st + dr) / 2;

        A1[2 * k] += A1[k];
        if (A1[2 * k] >= MOD) {
            A1[2 * k] -= MOD;
        }
        A2[2 * k] += A2[k];
        if (A2[2 * k] >= MOD) {
            A2[2 * k] -= MOD;
        }
        A1[2 * k + 1] += getElem(A1[k], A2[k], m + 1 - st);
        if (A1[2 * k + 1] >= MOD) {
            A1[2 * k + 1] -= MOD;
        }
        A2[2 * k + 1] += getElem(A1[k], A2[k], m + 1 - st + 1);
        if (A2[2 * k + 1] >= MOD) {
            A2[2 * k + 1] -= MOD;
        }

        Aint[2 * k] += getSum(A1[k], A2[k], 0, m - st);
        if (Aint[2 * k] >= MOD) {
            Aint[2 * k] -= MOD;
        }
        Aint[2 * k + 1] += getSum(A1[k], A2[k], m + 1 - st, dr - st);
        if (Aint[2 * k + 1] >= MOD) {
            Aint[2 * k + 1] -= MOD;
        }

        A1[k] = A2[k] = 0;
    }

    private int getElem(int a, int b, int k) {
        return (int) (((long) fib[k][0][0] * a + (long) fib[k][0][1] * b) % MOD);
    }

    private int getSum(int a, int b, int st, int dr) {
        int ret = getSingleSum(a, b, dr);
        if (st > 0) {
            ret -= getSingleSum(a, b, st - 1);
            if (ret < 0) {
                ret += MOD;
            }
        }
        return ret;
    }

    private int getSingleSum(int a, int b, int k) {
        return (int) (((long) sumFib[k][0][0] * a + (long) sumFib[k][0][1] * b) % MOD);
    }

    private void init(int k, int st, int dr) {
        if (st == dr) {
            Aint[k] = A[st];
            return;
        }

        int m = (st + dr) / 2;
        init(2 * k, st, m);
        init(2 * k + 1, m + 1, dr);

        Aint[k] = Aint[2 * k] + Aint[2 * k + 1];
        if (Aint[k] >= MOD) {
            Aint[k] -= MOD;
        }
    }
}

class InputReader {
    private InputStream stream;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;

    public InputReader(InputStream stream) {
        this.stream = stream;
    }

    public int read() {
        if (numChars == -1)
            throw new InputMismatchException();
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0)
                return -1;
        }
        return buf[curChar++];
    }

    public int nextInt() {
        return Integer.parseInt(nextString());
    }

    public String nextString() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        StringBuffer res = new StringBuffer();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isSpaceChar(c));

        return res.toString();
    }

    private boolean isSpaceChar(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

}

