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.
//package roundFF;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;

public class C4 {
	InputStream is;
	PrintWriter out;
	String INPUT = "";
	static final int mod = 1000000009;
	static final long s5 = 383008016;
	
	void solve()
	{
		long i2 = invl(2, mod);
		long plus = (1+s5)*i2%mod;
		long minus = (1-s5+mod)*i2%mod;
		long is5 = invl(s5, mod);
		
		int n = ni(), m = ni();
		int[] a = na(n);
		int[] cum = new int[n+1];
		for(int i = 0;i < n;i++){
			cum[i+1] = cum[i] + a[i];
			if(cum[i+1] >= mod)cum[i+1] -= mod;
		}
//		tr(i2, plus, minus, is5, s5);
		
		SegmentTreeRSQForGP stp = new SegmentTreeRSQForGP(n+1, (int)plus, mod);
		SegmentTreeRSQForGP stm = new SegmentTreeRSQForGP(n+1, (int)minus, mod);
		for(int q = 0;q < m;q++){
			int type = ni();
			if(type == 1){
				int L = ni()-1;
				int R = ni()-1;
				stp.add(L, R+2, (int)invl(stp.zpow[L], mod));
				stm.add(L, R+2, (int)invl(stm.zpow[L], mod));
			}else{
				int L = ni()-1;
				int R = ni()-1;
				long psum = stp.sum(0, R+2)-stp.sum(0, L+1);
				long msum = stm.sum(0, R+2)-stm.sum(0, L+1);
				out.println((cum[R+1]-cum[L]+mod+is5*(psum-msum+2L*mod))%mod);
			}
		}
	}
	
	public static long invl(long a, long mod) {
		long b = mod;
		long p = 1, q = 0;
		while (b > 0){
			long c = a / b;
			long d;
			d = a;
			a = b;
			b = d % b;
			d = p;
			p = q;
			q = d - c * q;
		}
		return p < 0 ? p + mod : p;
	}
	
	public static class SegmentTreeRSQForGP {
		public int M, H, N;
		public int[] st;
		public int[] plus;
		public int Z, mod;
		public long[] zpow;
		public long[] gps;
		
		public SegmentTreeRSQForGP(int n, int Z, int mod)
		{
			N = n;
			M = Integer.highestOneBit(Math.max(N-1, 1))<<2;
			H = M>>>1;
			st = new int[M];
			plus = new int[H];
			this.Z = Z;
			this.mod = mod;
			makeGP();
		}
		
		private void makeGP()
		{
			zpow = new long[H+1];
			gps = new long[H+1];
			zpow[0] = 1;
			gps[0] = 0;
			for(int i = 1;i <= H;i++){
				zpow[i] = zpow[i-1] * Z % mod;
				gps[i] = (gps[i-1] * Z + 1) % mod;
			}
		}
		
		private void propagate(int i)
		{
			int u = H/Integer.highestOneBit(i);
			st[i] = (int)((st[2*i]+st[2*i+1]*zpow[u/2]+plus[i]*gps[u]) % mod);
		}
		
		public void add(int l, int r, int v) { if(l < r)add(l, r, v, 0, H, 1); }
		
		protected void add(int l, int r, int v, int cl, int cr, int cur)
		{
			if(cur >= H){
				st[cur] += v;
				if(st[cur] >= mod)st[cur] -= mod;
			}else if(l <= cl && cr <= r){
				plus[cur] += v;
				if(plus[cur] >= mod)plus[cur] -= mod;
				propagate(cur);
			}else{
				int mid = cl+cr>>>1;
				if(cl < r && l < mid){
					add(l, r, v, cl, mid, 2*cur);
				}
				if(mid < r && l < cr){
					add(l, r, v, mid, cr, 2*cur+1);
				}
				propagate(cur);
			}
		}
		
		private static class Datum
		{
			public long sum;
			public int count;
			
			public Datum(long sum, int count) {
				this.sum = sum;
				this.count = count;
			}
		}
		
		public long sum(int l, int r) { 
			Datum d = sum(l, r, 0, H, 1);
			return d != null ? d.sum : 0L;
		}
		
		protected Datum sum(int l, int r, int cl, int cr, int cur)
		{
			if(l <= cl && cr <= r){
				return new Datum(st[cur], cr-cl);
			}else{
				Datum L = null, R = null;
				int mid = cl+cr>>>1;
				if(cl < r && l < mid){
					L = sum(l, r, cl, mid, 2*cur);
				}
				if(mid < r && l < cr){
					R = sum(l, r, mid, cr, 2*cur+1);
				}
				
				long lsum = L != null ? L.sum : 0L;
				int lcount = L != null ? L.count : 0;
				long rsum = R != null ? R.sum : 0L;
				int rcount = R != null ? R.count : 0;
				return new Datum(
						(lsum+rsum*zpow[lcount]+plus[cur]*gps[lcount+rcount])%mod,
						lcount+rcount
								);
			}
		}
	}
	
	void run() throws Exception
	{
		is = oj ? System.in : new ByteArrayInputStream(INPUT.getBytes());
		out = new PrintWriter(System.out);
		
		long s = System.currentTimeMillis();
		solve();
		out.flush();
		tr(System.currentTimeMillis()-s+"ms");
	}
	
	public static void main(String[] args) throws Exception { new C4().run(); }
	
	private byte[] inbuf = new byte[1024];
	private int lenbuf = 0, ptrbuf = 0;
	
	private int readByte()
	{
		if(lenbuf == -1)throw new InputMismatchException();
		if(ptrbuf >= lenbuf){
			ptrbuf = 0;
			try { lenbuf = is.read(inbuf); } catch (IOException e) { throw new InputMismatchException(); }
			if(lenbuf <= 0)return -1;
		}
		return inbuf[ptrbuf++];
	}
	
	private boolean isSpaceChar(int c) { return !(c >= 33 && c <= 126); }
	private int skip() { int b; while((b = readByte()) != -1 && isSpaceChar(b)); return b; }
	
	private double nd() { return Double.parseDouble(ns()); }
	private char nc() { return (char)skip(); }
	
	private String ns()
	{
		int b = skip();
		StringBuilder sb = new StringBuilder();
		while(!(isSpaceChar(b))){ // when nextLine, (isSpaceChar(b) && b != ' ')
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}
	
	private char[] ns(int n)
	{
		char[] buf = new char[n];
		int b = skip(), p = 0;
		while(p < n && !(isSpaceChar(b))){
			buf[p++] = (char)b;
			b = readByte();
		}
		return n == p ? buf : Arrays.copyOf(buf, p);
	}
	
	private char[][] nm(int n, int m)
	{
		char[][] map = new char[n][];
		for(int i = 0;i < n;i++)map[i] = ns(m);
		return map;
	}
	
	private int[] na(int n)
	{
		int[] a = new int[n];
		for(int i = 0;i < n;i++)a[i] = ni();
		return a;
	}
	
	private int ni()
	{
		int num = 0, b;
		boolean minus = false;
		while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
		if(b == '-'){
			minus = true;
			b = readByte();
		}
		
		while(true){
			if(b >= '0' && b <= '9'){
				num = num * 10 + (b - '0');
			}else{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}
	
	private long nl()
	{
		long num = 0;
		int b;
		boolean minus = false;
		while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
		if(b == '-'){
			minus = true;
			b = readByte();
		}
		
		while(true){
			if(b >= '0' && b <= '9'){
				num = num * 10 + (b - '0');
			}else{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}
	
	private boolean oj = System.getProperty("ONLINE_JUDGE") != null;
	private void tr(Object... o) { if(!oj)System.out.println(Arrays.deepToString(o)); }
}
