import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.InputMismatchException;

public class R105_D2_C {

    public static void main(String[] args) {
        //BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        InputReader4 in = new InputReader4(System.in);
        int n = in.readInt();
        int oh = in.readInt();
        int wow = in.readInt();
        int [] res = new int [n];
        Arrays.fill(res,1);
        int max = 50000;
        int sum = 1;
        for (int i = 1; i <= wow; i++) {
            int curr = sum+1;
            if(curr>max){
                System.out.println(-1);
                return;
            }
            res[i] = curr;
            sum += curr;
        }
        for (int i = wow+1; i < wow+oh+1; i++) {
            if(res[i-1]+1>max){
                System.out.println(-1);
                return;
            }
            res[i] = res[i-1] + 1;
        }
        System.out.print(res[0]);
        for (int i = 1; i < res.length; i++) {
            System.out.print(" "+res[i]);
        }
    }

    static class InputReader4 {
        private InputStream stream;
        private byte[] buf = new byte[1000];
        private int curChar, numChars;

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

        private 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 readInt() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public long readLong() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public String readString() {
            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;
        }

        private String readLine0() {
            StringBuffer buf = new StringBuffer();
            int c = read();
            while (c != '\n' && c != -1) {
                buf.appendCodePoint(c);
                c = read();
            }
            return buf.toString();
        }

        public String readLine() {
            String s = readLine0();
            while (s.trim().length() == 0)
                s = readLine0();
            return s;
        }

        public String readLine(boolean ignoreEmptyLines) {
            if (ignoreEmptyLines)
                return readLine();
            else
                return readLine0();
        }

        public char readCharacter() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            return (char) c;
        }

        public double readDouble() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            double res = 0;
            while (!isSpaceChar(c) && c != '.') {
                if (c == 'e' || c == 'E')
                    return res * Math.pow(10, readInt());
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            if (c == '.') {
                c = read();
                double m = 1;
                while (!isSpaceChar(c)) {
                    if (c == 'e' || c == 'E')
                        return res * Math.pow(10, readInt());
                    if (c < '0' || c > '9')
                        throw new InputMismatchException();
                    m /= 10;
                    res += (c - '0') * m;
                    c = read();
                }
            }
            return res * sgn;
        }
    }

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.InputMismatchException;

public class R105_D2_C {

    public static void main(String[] args) {
        //BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        InputReader4 in = new InputReader4(System.in);
        int n = in.readInt();
        int oh = in.readInt();
        int wow = in.readInt();
        int [] res = new int [n];
        Arrays.fill(res,1);
        int max = 50000;
        int sum = 1;
        for (int i = 1; i <= wow; i++) {
            int curr = sum+1;
            if(curr>max){
                System.out.println(-1);
                return;
            }
            res[i] = curr;
            sum += curr;
        }
        if(wow==0 && oh>0){
           wow = 1;
           sum = 2;
        }
        for (int i = wow+1; i < wow+oh+1; i++) {
            if(res[i-1]+1>max || res[i-1]+1>sum || i>=res.length){
                System.out.println(-1);
                return;
            }
            res[i] = res[i-1] + 1;
            sum += res[i];
        }
        System.out.print(res[0]);
        for (int i = 1; i < res.length; i++) {
            System.out.print(" "+res[i]);
        }
    }

    static class InputReader4 {
        private InputStream stream;
        private byte[] buf = new byte[1000];
        private int curChar, numChars;

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

        private 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 readInt() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public long readLong() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public String readString() {
            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;
        }

        private String readLine0() {
            StringBuffer buf = new StringBuffer();
            int c = read();
            while (c != '\n' && c != -1) {
                buf.appendCodePoint(c);
                c = read();
            }
            return buf.toString();
        }

        public String readLine() {
            String s = readLine0();
            while (s.trim().length() == 0)
                s = readLine0();
            return s;
        }

        public String readLine(boolean ignoreEmptyLines) {
            if (ignoreEmptyLines)
                return readLine();
            else
                return readLine0();
        }

        public char readCharacter() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            return (char) c;
        }

        public double readDouble() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            double res = 0;
            while (!isSpaceChar(c) && c != '.') {
                if (c == 'e' || c == 'E')
                    return res * Math.pow(10, readInt());
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            if (c == '.') {
                c = read();
                double m = 1;
                while (!isSpaceChar(c)) {
                    if (c == 'e' || c == 'E')
                        return res * Math.pow(10, readInt());
                    if (c < '0' || c > '9')
                        throw new InputMismatchException();
                    m /= 10;
                    res += (c - '0') * m;
                    c = read();
                }
            }
            return res * sgn;
        }
    }

}


import java.io.*;
import java.util.*;

import static java.lang.Math.*;

public class C implements Runnable {

	BufferedReader in;
	PrintWriter out;
	StringTokenizer tok;

	public static void main(String[] args) {
		new Thread(null, new C(), "", 256*1024*1024).start();
	}

	@Override
	public void run() {
		try {
			long t1 = System.currentTimeMillis();
			long m1 = Runtime.getRuntime().freeMemory();
			if (System.getProperty("ONLINE_JUDGE") == null) {
				in = new BufferedReader(new FileReader("input.txt"));
				out = new PrintWriter("output.txt");
			} else {
				in = new BufferedReader(new InputStreamReader(System.in));
				out = new PrintWriter(System.out);
			}
			Locale.setDefault(Locale.US);
			tok = new StringTokenizer("");
			solve();
			in.close();
			out.close();
			long t2 = System.currentTimeMillis();
			long m2 = Runtime.getRuntime().freeMemory();
			System.err.println("Time = " + (t2 - t1) + " ms.");
			System.err.println("Memory = " + ((m1 - m2) / 1024) + " KB.");
		} catch (Throwable e) {
			e.printStackTrace(System.err);
			System.exit(-1);
		}
	}

	String readString() throws IOException {
		while (!tok.hasMoreTokens()) {
			tok = new StringTokenizer(in.readLine());
		}
		return tok.nextToken();
	}

	int readInt() throws IOException {
		return Integer.parseInt(readString());
	}

	long readLong() throws IOException {
		return Long.parseLong(readString());
	}

	double readDouble() throws IOException {
		return Double.parseDouble(readString());
	}

	void debug(Object... o) {
		System.err.println(Arrays.deepToString(o));
	}

//------------------------------------------------------------------------------

	void solve() throws IOException {
		int n = readInt();
		int a = readInt();
		int b = readInt();
		if (n == 1) {
			out.print(1);
			return;
		}
		if (b == 0) {
			if (a+1 == n) {
				out.println(-1);
				return;
			}
			List<Integer> list = new ArrayList<Integer>();
			list.add(1);
			list.add(1);
			int x = 2;
			for (int i = 0; i < a; i++) {
				list.add(x);
				x++;
			}
			for (int i = 0; i < n-2-a; i++) {
				list.add(1);
			}
			for (int i = 0; i < n; i++) {
				out.print(list.get(i) + " ");
			}
			return;
		}
		List<Integer> list = new ArrayList<Integer>();
		int x = 1;
		list.add(x);
		for (int i = 0; i < b; i++) {
			x *= 2;
			list.add(x);
		}
		for (int i = 0; i < a; i++) {
			x++;
			list.add(x);
		}
		for (int i = 0; i < n-a-b; i++) {
			list.add(1);
		}
		for (int i = 0; i < n; i++) {
			out.print(list.get(i) + " ");
		}
	}

}


import java.io.*;
import java.util.*;

import static java.lang.Math.*;

public class C implements Runnable {

	BufferedReader in;
	PrintWriter out;
	StringTokenizer tok;

	public static void main(String[] args) {
		new Thread(null, new C(), "", 256*1024*1024).start();
	}

	@Override
	public void run() {
		try {
			long t1 = System.currentTimeMillis();
			long m1 = Runtime.getRuntime().freeMemory();
			if (System.getProperty("ONLINE_JUDGE") == null) {
				in = new BufferedReader(new FileReader("input.txt"));
				out = new PrintWriter("output.txt");
			} else {
				in = new BufferedReader(new InputStreamReader(System.in));
				out = new PrintWriter(System.out);
			}
			Locale.setDefault(Locale.US);
			tok = new StringTokenizer("");
			solve();
			in.close();
			out.close();
			long t2 = System.currentTimeMillis();
			long m2 = Runtime.getRuntime().freeMemory();
			System.err.println("Time = " + (t2 - t1) + " ms.");
			System.err.println("Memory = " + ((m1 - m2) / 1024) + " KB.");
		} catch (Throwable e) {
			e.printStackTrace(System.err);
			System.exit(-1);
		}
	}

	String readString() throws IOException {
		while (!tok.hasMoreTokens()) {
			tok = new StringTokenizer(in.readLine());
		}
		return tok.nextToken();
	}

	int readInt() throws IOException {
		return Integer.parseInt(readString());
	}

	long readLong() throws IOException {
		return Long.parseLong(readString());
	}

	double readDouble() throws IOException {
		return Double.parseDouble(readString());
	}

	void debug(Object... o) {
		System.err.println(Arrays.deepToString(o));
	}

//------------------------------------------------------------------------------

	void solve() throws IOException {
		int n = readInt();
		int a = readInt();
		int b = readInt();
		if (n == 1) {
			out.print(1);
			return;
		}
		if (b == 0) {
			if (a+1 == n) {
				out.println(-1);
				return;
			}
			List<Integer> list = new ArrayList<Integer>();
			list.add(50000);
			list.add(1);
			int x = 2;
			for (int i = 0; i < a; i++) {
				list.add(x);
				x++;
			}
			for (int i = 0; i < n-2-a; i++) {
				list.add(1);
			}
			for (int i = 0; i < n; i++) {
				out.print(list.get(i) + " ");
			}
			return;
		}
		List<Integer> list = new ArrayList<Integer>();
		int x = 1;
		list.add(x);
		for (int i = 0; i < b; i++) {
			x *= 2;
			list.add(x);
		}
		for (int i = 0; i < a; i++) {
			x++;
			list.add(x);
		}
		for (int i = 0; i < n-a-b; i++) {
			list.add(1);
		}
		for (int i = 0; i < n; i++) {
			out.print(list.get(i) + " ");
		}
	}

}


import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.StreamTokenizer;
import java.util.Arrays;

public class C {

    public static void main(String[] args) throws Exception {
        int n = nextInt(), a = nextInt(), b = nextInt();

        long[] mas = new long[n];

        Arrays.fill(mas, 1);
        long sum = 1;
        int i = 1;

        if(b == 0) {
            /*
            out.print("50000 ");
            for(i = 1; i<n; i++) {
                if(a == 0)break;
                a--;
                mas[i] = i == 1 ? 1 : (mas[i-1] + 1);
            } /**/
            mas[0] = 2;
        }

        for(; i<n; i++) {
            if(b == 0)break;
            mas[i] = sum+1;
            sum += mas[i];
            b--;
        }
        if(mas[i-1] > 50000) {
            exit(-1);
        }
        for(;i<n; i++) {
            if(a == 0)break;
            mas[i] = mas[i-1]+1;
            a--;
        }
        if(mas[i-1] > 50000) {
            exit(-1);
        }
        for(i = 0; i<n; i++) {
            out.print(mas[i] + " ");
        }
        out.println();
        out.flush();
    }

    /////////////////////////////////////////////////////////////////
    // IO
    /////////////////////////////////////////////////////////////////
    private static StreamTokenizer in;
    private static PrintWriter out;
    private static BufferedReader inB;

    private static boolean FILE=false;

    private static int nextInt() throws Exception{
        in.nextToken();
        return (int)in.nval;
    }

    private static String nextString() throws Exception{
        in.nextToken();
        return in.sval;
    }

    static{
        try {
            out = new PrintWriter(FILE ? (new FileOutputStream("output.txt")) : System.out);
            inB = new BufferedReader(new InputStreamReader(FILE ? new FileInputStream("input.txt") : System.in));
        } catch(Exception e) {e.printStackTrace();}
        in = new StreamTokenizer(inB);
    }
    /////////////////////////////////////////////////////////////////

    /////////////////////////////////////////////////////////////////
    // pre - written
    /////////////////////////////////////////////////////////////////
    private static void println(Object o) throws Exception {
        out.println(o);
        out.flush();
    }
    private static void exit(Object o) throws Exception {
        println(o);
        exit();
    }
    private static void exit() {
        System.exit(0);
    }
    private static final int  INF = Integer.MAX_VALUE;
    private static final int MINF = Integer.MIN_VALUE;
    //////////////////////////////////////////////////////////////////
}


import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.StreamTokenizer;
import java.util.Arrays;

public class C {

    public static void main(String[] args) throws Exception {
        int n = nextInt(), a = nextInt(), b = nextInt();

        long[] mas = new long[n];
        Arrays.fill(mas, 1);
        long sum = 1;
        int i = 1;
        for(; i<n; i++) {
            if(b == 0)break;
            mas[i] = sum+1;
            sum += mas[i];
            b--;
        }
        for(;i<n; i++) {
            if(a == 0)break;
            mas[i] = mas[i-1]+1;
            a--;
        }
        if(mas[i-1] > 50000) {
            exit(-1);
        }
        for(i = 0; i<n; i++) {
            out.print(mas[i] + " ");
        }
        out.println();
        out.flush();
    }

    /////////////////////////////////////////////////////////////////
    // IO
    /////////////////////////////////////////////////////////////////
    private static StreamTokenizer in;
    private static PrintWriter out;
    private static BufferedReader inB;

    private static boolean FILE=false;

    private static int nextInt() throws Exception{
        in.nextToken();
        return (int)in.nval;
    }

    private static String nextString() throws Exception{
        in.nextToken();
        return in.sval;
    }

    static{
        try {
            out = new PrintWriter(FILE ? (new FileOutputStream("output.txt")) : System.out);
            inB = new BufferedReader(new InputStreamReader(FILE ? new FileInputStream("input.txt") : System.in));
        } catch(Exception e) {e.printStackTrace();}
        in = new StreamTokenizer(inB);
    }
    /////////////////////////////////////////////////////////////////

    /////////////////////////////////////////////////////////////////
    // pre - written
    /////////////////////////////////////////////////////////////////
    private static void println(Object o) throws Exception {
        out.println(o);
        out.flush();
    }
    private static void exit(Object o) throws Exception {
        println(o);
        exit();
    }
    private static void exit() {
        System.exit(0);
    }
    private static final int  INF = Integer.MAX_VALUE;
    private static final int MINF = Integer.MIN_VALUE;
    //////////////////////////////////////////////////////////////////
}


import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.StreamTokenizer;
import java.util.Arrays;

public class C {

    public static void main(String[] args) throws Exception {
        int n = nextInt(), a = nextInt(), b = nextInt();

        long[] mas = new long[n];

        Arrays.fill(mas, 1);
        long sum = 1;
        int i = 1;

        if(n == 1) {
            exit(1);
        }

        if(b == 0) {
            if(a > n - 2) exit(-1);
            i = 2;
            /*
            out.print("50000 ");
            for(i = 1; i<n; i++) {
                if(a == 0)break;
                a--;
                mas[i] = i == 1 ? 1 : (mas[i-1] + 1);
            } /**/
        }

        for(; i<n; i++) {
            if(b == 0)break;
            mas[i] = sum+1;
            sum += mas[i];
            b--;
        }
        for(;i<n; i++) {
            if(a == 0)break;
            mas[i] = mas[i-1]+1;
            a--;
        }
        if(mas[i-1] > 50000) {
            exit(-1);
        }
        for(i = 0; i<n; i++) {
            out.print(mas[i] + " ");
        }
        out.println();
        out.flush();
    }

    /////////////////////////////////////////////////////////////////
    // IO
    /////////////////////////////////////////////////////////////////
    private static StreamTokenizer in;
    private static PrintWriter out;
    private static BufferedReader inB;

    private static boolean FILE=false;

    private static int nextInt() throws Exception{
        in.nextToken();
        return (int)in.nval;
    }

    private static String nextString() throws Exception{
        in.nextToken();
        return in.sval;
    }

    static{
        try {
            out = new PrintWriter(FILE ? (new FileOutputStream("output.txt")) : System.out);
            inB = new BufferedReader(new InputStreamReader(FILE ? new FileInputStream("input.txt") : System.in));
        } catch(Exception e) {e.printStackTrace();}
        in = new StreamTokenizer(inB);
    }
    /////////////////////////////////////////////////////////////////

    /////////////////////////////////////////////////////////////////
    // pre - written
    /////////////////////////////////////////////////////////////////
    private static void println(Object o) throws Exception {
        out.println(o);
        out.flush();
    }
    private static void exit(Object o) throws Exception {
        println(o);
        exit();
    }
    private static void exit() {
        System.exit(0);
    }
    private static final int  INF = Integer.MAX_VALUE;
    private static final int MINF = Integer.MIN_VALUE;
    //////////////////////////////////////////////////////////////////
}


import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.StreamTokenizer;
import java.util.Arrays;

public class C {

    public static void main(String[] args) throws Exception {
        int n = nextInt(), a = nextInt(), b = nextInt();

        long[] mas = new long[n];

        Arrays.fill(mas, 1);
        long sum = 1;
        int i = 1;

        if(b == 0) {
            if(a > n - 2) {
                exit(-1);
            }
            i = 2;
        }

        for(; i<n; i++) {
            if(b == 0)break;
            mas[i] = sum+1;
            sum += mas[i];
            b--;
        }
        if(mas[i-1] > 50000) {
            exit(-1);
        }
        for(;i<n; i++) {
            if(a == 0)break;
            mas[i] = mas[i-1]+1;
            a--;
        }
        if(mas[i-1] > 50000) {
            exit(-1);
        }
        for(i = 0; i<n; i++) {
            out.print(mas[i] + " ");
        }
        out.println();
        out.flush();
    }

    /////////////////////////////////////////////////////////////////
    // IO
    /////////////////////////////////////////////////////////////////
    private static StreamTokenizer in;
    private static PrintWriter out;
    private static BufferedReader inB;

    private static boolean FILE=false;

    private static int nextInt() throws Exception{
        in.nextToken();
        return (int)in.nval;
    }

    private static String nextString() throws Exception{
        in.nextToken();
        return in.sval;
    }

    static{
        try {
            out = new PrintWriter(FILE ? (new FileOutputStream("output.txt")) : System.out);
            inB = new BufferedReader(new InputStreamReader(FILE ? new FileInputStream("input.txt") : System.in));
        } catch(Exception e) {e.printStackTrace();}
        in = new StreamTokenizer(inB);
    }
    /////////////////////////////////////////////////////////////////

    /////////////////////////////////////////////////////////////////
    // pre - written
    /////////////////////////////////////////////////////////////////
    private static void println(Object o) throws Exception {
        out.println(o);
        out.flush();
    }
    private static void exit(Object o) throws Exception {
        println(o);
        exit();
    }
    private static void exit() {
        System.exit(0);
    }
    private static final int  INF = Integer.MAX_VALUE;
    private static final int MINF = Integer.MIN_VALUE;
    //////////////////////////////////////////////////////////////////
}


import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int a = in.nextInt();
        int b = in.nextInt();
        if (n - 1 == a) {
            if (a != 0)
                System.out.println(-1);
            else
                System.out.println("1");
        } else {
            System.out.print("1");
            for (int i = 1; i <= b; i++) {
                System.out.print(" " + (int) Math.pow(2, i));
            }
            int k = (int) Math.pow(2, b);
            if (b == 0) {
                System.out.print(" 1");
                n--;
            }
            for (int i = 1; i <= a; i++) {
                System.out.print(" " + (k + i));
            }
            for (int i = a + b + 1; i < n; i++) {
                System.out.print(" " + (k + a));
            }
            System.out.println();
        }
    }

}


import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int a = in.nextInt();
        int b = in.nextInt();
        if (n - 1 == a) {
            System.out.println(-1);
        } else {
            System.out.print("1");
            for (int i = 1; i <= b; i++) {
                System.out.print(" " + (int) Math.pow(2, i));
            }
            int k = (int) Math.pow(2, b);
            if(b==0){
                System.out.print(" 1");
                n--;
            }
            for (int i = 1; i <= a; i++) {
                System.out.print(" " + (k + i));
            }
            for (int i = a + b + 1; i < n; i++) {
                System.out.print(" " + (k + a));
            }
            System.out.println();
        }
    }

}


import java.io.*;
import static java.lang.Integer.*;
public class round105C {
    public static void main(String[] args)throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String [] use = br.readLine().split(" ");
        int n = parseInt(use[0]);
        int a = parseInt(use[1]);
        int b = parseInt(use[2]);
        int last = 2;
        int curSum = 2;
        int [] ans = new int [n];
        ans[0] = last;
        for(int i = 1 ; i < n ; ++i){
            if(i == 1){
                if(b == 0){
                    ans[i] = 1;
                    curSum += 1;
                    continue;
                }
            }
            if(b > 0){
                ans[i] = curSum + 1;
                curSum += ans[i];
                last = ans[i];
                --b;
            }else{
                if(a > 0){
                    ans[i] = last + 1;
                    last++;
                    --a;
                }else{
                    ans[i] = 1;
                }
            }
        }
        if(a != 0 || b != 0){
            System.out.println(-1);
        }else{
            for(int i = 0 ; i < ans.length ; ++i)
                System.out.print(ans[i] + " ");
        }
    }

}


import java.io.*;
import static java.lang.Integer.*;
public class round105C {
    public static void main(String[] args)throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String [] use = br.readLine().split(" ");
        int n = parseInt(use[0]);
        int a = parseInt(use[1]);
        int b = parseInt(use[2]);
        int last = 2;
        int curSum = 2;
        int [] ans = new int [n];
        ans[0] = last;
        for(int i = 1 ; i < n ; ++i){
            if(i == 1){
                if(b == 0){
                    ans[i] = 1;
                    curSum += 1;
                    continue;
                }
            }
            if(b > 0){
                ans[i] = curSum + 1;
                curSum += ans[i];
                last = ans[i];
                --b;
            }else{
                if(a > 0){
                    ans[i] = last + 1;
                    last++;
                    --a;
                }else{
                    ans[i] = last - 1;
                    --last;
                }
            }
        }
        if(a != 0 || b != 0){
            System.out.println(-1);
        }else{
            for(int i = 0 ; i < ans.length ; ++i)
                System.out.print(ans[i] + " ");
        }
    }

}


import java.io.*;
import static java.lang.Integer.*;
public class round105C {
    public static void main(String[] args)throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String [] use = br.readLine().split(" ");
        int n = parseInt(use[0]);
        int a = parseInt(use[1]);
        int b = parseInt(use[2]);
        int last = 100;
        int curSum = 100;
        int [] ans = new int [n];
        ans[0] = last;
        for(int i = 1 ; i < n ; ++i){
            if(i == 1){
                if(b == 0){
                    ans[i] = 99;
                    curSum += 99;
                    continue;
                }
            }
            if(b > 0){
                ans[i] = curSum + 1;
                curSum += ans[i];
                last = ans[i];
                --b;
            }else{
                if(a > 0){
                    ans[i] = last + 1;
                    last++;
                    --a;
                }else{
                    ans[i] = last - 1;
                    --last;
                }
            }
        }
        if(a != 0 || b != 0){
            System.out.println(-1);
        }else{
            for(int i = 0 ; i < ans.length ; ++i)
                System.out.print(ans[i] + " ");
        }
    }

}


#include <iostream>
#include <vector>
#include <set>
#include <unordered_map>
#include <algorithm>

using namespace std;

const long long mod = 1e9 + 7;

int main() {
    long long n;
    cin >> n;
    set<long long> s;
    //0-buy
    //1-sell
    unordered_map<long long, long long> f;
    vector<long long> v;
    long long rez = 1;
    for (long long i = 0; i < n; i++)
    {
        string str;
        long long p;
        cin >> str >> p;
        if (str == "ADD")
        {
            v.push_back(p);
            f[p] = 2;
        }
        else
        {
            rez = rez * max(1ll, f[p]) % mod;
            if (!s.empty())
            {
                auto it = upper_bound(s.begin(), s.end(), p);
                if (p < *s.rbegin())
                {
                    if (f[*it] == 0)
                    {
                        cout << 0;
                        return 0;
                    }
                }
                if (p > *s.begin())
                {
                    if (it == s.end())
                    {
                        it--;
                    }
                    it--;
                    if (f[*it] == 1)
                    {
                        cout << 0;
                        return 0;
                    }
                }
            }
            for (long long i = 0; i < v.size(); i++)
            {
                if (v[i] < p)
                {
                    f[v[i]] = 0;
                }
                if (v[i] > p)
                {
                    f[v[i]] = 1;
                }
                s.insert(v[i]);
            }
            v.clear();
            s.erase(p);
        }
    }
    cout << rez;
    return 0;
}


#include <iostream>
#include <vector>
#include <set>
#include <unordered_map>
#include <algorithm>

using namespace std;

const long long mod = 1e9 + 7;

int main() {
    long long n;
    cin >> n;
    set<long long> s;
    //0-buy
    //1-sell
    unordered_map<long long, long long> f;
    vector<long long> v;
    long long rez = 1, alt_rez = 1, alt2 = 1;
    bool ff = false;
    for (long long i = 0; i < n; i++)
    {
        alt_rez = alt_rez * 2 % mod;
        string str;
        long long p;
        cin >> str >> p;
        alt2 *= 2;
        if (str == "ADD")
        {
            v.push_back(p);
            f[p] = 2;
        }
        else
        {
            alt2 = 1;
            ff = true;
            rez = rez * max(1ll, f[p]) % mod;
            if (!s.empty())
            {
                auto it = upper_bound(s.begin(), s.end(), p);
                if (p < *s.rbegin())
                {
                    if (f[*it] == 0)
                    {
                        cout << 0;
                        return 0;
                    }
                }
                if (p > *s.begin())
                {
                    if (it == s.end())
                    {
                        it--;
                    }
                    it--;
                    if (f[*it] == 1)
                    {
                        cout << 0;
                        return 0;
                    }
                }
            }
            for (long long i = 0; i < v.size(); i++)
            {
                if (v[i] < p)
                {
                    f[v[i]] = 0;
                }
                if (v[i] > p)
                {
                    f[v[i]] = 1;
                }
                s.insert(v[i]);
            }
            v.clear();
            s.erase(p);
        }
    }
    if (!ff)
    {
        cout << alt_rez;
    }
    else
    {
        cout << rez * alt2;
    }
    return 0;
}


#include <iostream>
#include <vector>
#include <set>
#include <unordered_map>
#include <algorithm>

using namespace std;

const int mod = 1e9 + 7;

int main() {
    int n;
    cin >> n;
    set<int> s;
    //0-buy
    //1-sell
    unordered_map<int, int> f;
    vector<int> v;
    int rez = 1;
    for (int i = 0; i < n; i++)
    {
        string str;
        int p;
        cin >> str >> p;
        if (str == "ADD")
        {
            v.push_back(p);
            f[p] = 2;
        }
        else
        {
            if (!s.empty())
            {
                auto it = upper_bound(s.begin(), s.end(), p);
                if (p < *s.rbegin())
                {
                    if (f[*it] == 0)
                    {
                        cout << 0;
                        return 0;
                    }
                }
                if (p > *s.begin())
                {
                    it--;
                    if (f[*it] == 1)
                    {
                        cout << 0;
                        return 0;
                    }
                }
            }
            for (int i = 0; i < v.size(); i++)
            {
                if (v[i] < p)
                {
                    f[v[i]] = 0;
                }
                else
                {
                    f[v[i]] = 1;
                }
                s.insert(v[i]);
            }
            v.clear();
            f[p] = 2;
            s.erase(p);
            rez = rez * 2 % mod;
        }
    }
    cout << rez;
    return 0;
}


#include <iostream>
#include <vector>
#include <set>
#include <unordered_map>
#include <algorithm>

using namespace std;

const long long mod = 1e9 + 7;

int main() {
    long long n;
    cin >> n;
    set<long long> s;
    //0-buy
    //1-sell
    unordered_map<long long, long long> f;
    vector<long long> v;
    long long rez = 1;
    for (long long i = 0; i < n; i++)
    {
        string str;
        long long p;
        cin >> str >> p;
        if (str == "ADD")
        {
            v.push_back(p);
            f[p] = 2;
        }
        else
        {
            rez = rez * max(1ll, f[p]) % mod;
            if (!s.empty())
            {
                auto it = upper_bound(s.begin(), s.end(), p);
                if (p < *s.rbegin())
                {
                    if (f[*it] == 0)
                    {
                        cout << 0;
                        return 0;
                    }
                }
                if (p > *s.begin())
                {
                    it--;
                    if (f[*it] == 1)
                    {
                        cout << 0;
                        return 0;
                    }
                }
            }
            for (long long i = 0; i < v.size(); i++)
            {
                if (v[i] < p)
                {
                    f[v[i]] = 0;
                }
                else
                {
                    f[v[i]] = 1;
                }
                s.insert(v[i]);
            }
            v.clear();
            s.erase(p);
        }
    }
    cout << rez;
    return 0;
}


#include <bits/stdc++.h>

#define int long long
#define fi first
#define se second

using namespace std;

//const int MAXN = ;
const int MOD = 1e9 + 7;

signed main() {
    cin.tie(0);
    cout.tie(0);
    ios_base :: sync_with_stdio(0);
    int n;
    cin >> n;
    set<int> sell, buy, undef;
    int ans = 1;
    for (int i = 0; i < n; i++)
    {
        string s;
        int k;
        cin >> s >> k;
        if (s == "ACCEPT")
        {
            if (sell.find(k) != sell.end())
            {
                if (k != *sell.begin())
                {
                    cout << 0;
                    return 0;
                }
                sell.erase(k);
            }
            if (buy.find(k) != buy.end())
            {
                if (k != *buy.rbegin())
                {
                    cout << 0;
                    return 0;
                }
                buy.erase(k);
            }
            if (undef.find(k) != undef.end())
            {
                ans *= 2;
                ans %= MOD;
                undef.erase(k);
                while(!undef.empty())
                {
                    int x = *undef.begin();
                    undef.erase(x);
                    if (x < k)
                    {
                        buy.insert(x);
                    }
                    else
                    {
                        sell.insert(x);
                    }
                }
            }
            continue;
        }
        if (!sell.empty() && k > *sell.begin())
        {
            sell.insert(k);
        }
        else if (!buy.empty() && k < *buy.rbegin())
        {
            buy.insert(k);
        }
        else
        {
            undef.insert(k);
        }
    }
    cout << ans;
    return 0;
}


#pragma GCC optimize("O3")
#ifdef ONLINE_JUDGE
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#endif
#pragma GCC optimize("unroll-loops")
#pragma comment(linker, "/stack:200000000")
#include <bits/stdc++.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>
template<typename Key=int,typename Mapped=__gnu_pbds::null_type,typename Cmp_Fn=std::less<Key>,typename Tag=__gnu_pbds::rb_tree_tag,template<typename Const_Node_Iterator,typename Node_Iterator,typename Cmp_Fn_,typename Allocator_>class Node_Update=__gnu_pbds::tree_order_statistics_node_update,typename Allocator=std::allocator<char>>class ordered_set_t:__gnu_pbds::tree<Key,Mapped,Cmp_Fn,Tag,Node_Update,Allocator>{};const int GRANDOM=std::chrono::high_resolution_clock::now().time_since_epoch().count();struct ghash{int operator()(int x){return std::hash<int>{}(x^GRANDOM);}};template<typename KeyType>class hash_table_t:__gnu_pbds::gp_hash_table<KeyType,int,ghash>{};namespace vh{template<class T>void _R(T&x){std::cin>>x;}inline void _R(int&x){scanf("%d",&x);}inline void _R(int64_t&x){scanf("%" SCNd64,&x);}inline void _R(double&x){scanf("%lf",&x);}inline void _R(char&x){scanf("%c",&x);}inline void _R(char*x){scanf("%s",x);}inline void R(){}template<class T,class... U>inline void R(T&head,U&... tail){_R(head);R(tail...);}template<class T>void _W(const T&x){cout<<x;}inline void _W(const int&x){printf("%d",x);}inline void _W(const int64_t&x){printf("%" PRId64,x);}inline void _W(const double&x){printf("%.16f",x);}inline void _W(const char&x){putchar(x);}inline void _W(const char*x){printf("%s",x);}template<class T>inline void _W(const vector<T>&x){for(auto i=x.begin();i!=x.end();_W(*i++))if(i!=x.cbegin())putchar(' ');}inline void W(){}template<class T,class... U>inline void W(const T&head,const U&... tail){_W(head);if(sizeof...(tail))putchar(' '),W(tail...);}template<class T,class... U>inline void WL(const T&head,const U&... tail){_W(head);putchar(sizeof...(tail)? ' ':'\n');W(tail...);}};
#define prec setprecision
namespace vh{typedef long long ll;typedef unsigned long long llu;template<typename T>T gcd(T m,T n){while(n){T t=m%n;m=n;n=t;};return m;}template<typename T>T exgcd(T a,T b,T&sa,T&ta){T q,r,sb=0,tb=1,sc,tc;sa=1,ta=0;if(b)do q=a/b,r=a-q*b,a=b,b=r,sc=sa-q*sb,sa=sb,sb=sc,tc=ta-q*tb,ta=tb,tb=tc;while(b);return a;}template<typename T>T mul_inv(T a,T b){T t1=a,t2=b,t3;T v1=1,v2=0,v3;T x;while(t2!=1)x=t1/t2,t3=t1-x*t2,v3=v1-x*v2,t1=t2,t2=t3,v1=v2,v2=v3;return(v2+b)%b;}template<typename T>T powmod(T a,T b,T MOD){if(b<0)return 0;T rv=1;while(b)(b%2)&&(rv=(rv*a)%MOD),a=a*a%MOD,b/=2;return rv;}template<ll n>struct BitSize{enum{Size=BitSize<n/2>::Size+1};};template<>struct BitSize<0>{enum{Size=1};};template<>struct BitSize<1>{enum{Size=1};};
#define BITSIZE(n) (BitSize<n>::Size)
#define BITMAX(n) (BitSize<n>::Size - 1)
#define DEBUG !defined(ONLINE_JUDGE)
#define SZ(x) ((int)(x).size())
#define ALL(x) begin(x), end(x)
template<typename TH>void _dbg(const char*sdbg,TH h){cerr<<sdbg<<"="<<h<<"\n";}template<typename TH,typename... TA>void _dbg(const char*sdbg,TH h,TA... t){while(*sdbg!=',')cerr<<*sdbg++;cerr<<"="<<h<<",";_dbg(sdbg+1,t...);}
#ifdef DEBUG
#define debug(...) _dbg(#__VA_ARGS__, __VA_ARGS__)
#define debugv(x) {{cerr <<#x <<" = "; for(auto itt: x) cerr <<*itt <<", "; cerr <<"\n"; }}
#else
#define debug(...) (__VA_ARGS__)
#define debugv(x)
#define cerr if(0)cout
#endif
}namespace vh{template<typename T>int min_rotation(vector<T>s){int a=0,N=s.size();for(int b=0;b<N;b++)for(int i=0;i<N;i++){if(a+i==b||s[(a+i)%N]<s[(b+i)%N]){b+=max(0,i-1);break;}if(s[(a+i)%N]>s[(b+i)%N]){a=b;break;}}return a;}}namespace vh{};
namespace vh{
  const int maxn=363363;
  const ll MOD=1e9+7;
  set<int>possible_buy;
  set<int>remains;
  set<int,greater<int>>possible_sell;
  int n;
  ll values[maxn];
  bool is_add[maxn];
  int main(){
    srand(GRANDOM);
    cin>>n;
    ll r=1;
    for(int i=1;i<=n;i++){
      ll&x=values[i];
      char s[20];cin>>s>>x;
      is_add[i]=(s[1]=='D');
      if(!is_add[i]){
        if(possible_buy.find(x)==possible_buy.end()&&possible_sell.find(x)==possible_sell.end()){
          r=0;break;
        }
        vector<ll>to_remove;
        for(auto v:possible_buy){
          if(v>=x)break;
          to_remove.push_back(v);
        }
        if(!to_remove.empty())for(auto v:to_remove){
          possible_buy.erase(v);
        }
        to_remove.clear();
        for(auto v:possible_sell){
          if(v<=x)break;
          to_remove.push_back(v);
        }
        if(!to_remove.empty())for(auto v:to_remove){
          possible_sell.erase(v);
        }
        ll rr=0;
        if(possible_buy.find(x)!=possible_buy.end())rr++;
        if(possible_sell.find(x)!=possible_sell.end())rr++;
        r=(r*rr)%MOD;
        possible_buy.erase(x);
        possible_sell.erase(x);
        remains.erase(x);
      }else{
        if(possible_buy.find(x)!=possible_buy.end()||possible_sell.find(x)!=possible_sell.end()){
          r=0;break;
        }
        possible_buy.insert(x);
        possible_sell.insert(x);
        remains.insert(x);
      }
    }
    if(r){
      for(auto x:remains){
          ll rr=0;
          if(possible_buy.find(x)!=possible_buy.end())rr++;
          if(possible_sell.find(x)!=possible_sell.end())rr++;
          r=(r*rr)%MOD;
      }
    }
    cout<<r<<endl;
    return 0;
  }
};
int main(int argc,char*argv[]){
  std::cin.sync_with_stdio(false);std::cin.tie(nullptr);
  return vh::main();
}


#pragma GCC optimize("O3")
#ifdef ONLINE_JUDGE
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#endif
#pragma GCC optimize("unroll-loops")
#pragma comment(linker, "/stack:200000000")
#include <bits/stdc++.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>
template<typename Key=int,typename Mapped=__gnu_pbds::null_type,typename Cmp_Fn=std::less<Key>,typename Tag=__gnu_pbds::rb_tree_tag,template<typename Const_Node_Iterator,typename Node_Iterator,typename Cmp_Fn_,typename Allocator_>class Node_Update=__gnu_pbds::tree_order_statistics_node_update,typename Allocator=std::allocator<char>>class ordered_set_t:__gnu_pbds::tree<Key,Mapped,Cmp_Fn,Tag,Node_Update,Allocator>{};const int GRANDOM=std::chrono::high_resolution_clock::now().time_since_epoch().count();struct ghash{int operator()(int x){return std::hash<int>{}(x^GRANDOM);}};template<typename KeyType>class hash_table_t:__gnu_pbds::gp_hash_table<KeyType,int,ghash>{};namespace vh{template<class T>void _R(T&x){std::cin>>x;}inline void _R(int&x){scanf("%d",&x);}inline void _R(int64_t&x){scanf("%" SCNd64,&x);}inline void _R(double&x){scanf("%lf",&x);}inline void _R(char&x){scanf("%c",&x);}inline void _R(char*x){scanf("%s",x);}inline void R(){}template<class T,class... U>inline void R(T&head,U&... tail){_R(head);R(tail...);}template<class T>void _W(const T&x){cout<<x;}inline void _W(const int&x){printf("%d",x);}inline void _W(const int64_t&x){printf("%" PRId64,x);}inline void _W(const double&x){printf("%.16f",x);}inline void _W(const char&x){putchar(x);}inline void _W(const char*x){printf("%s",x);}template<class T>inline void _W(const vector<T>&x){for(auto i=x.begin();i!=x.end();_W(*i++))if(i!=x.cbegin())putchar(' ');}inline void W(){}template<class T,class... U>inline void W(const T&head,const U&... tail){_W(head);if(sizeof...(tail))putchar(' '),W(tail...);}template<class T,class... U>inline void WL(const T&head,const U&... tail){_W(head);putchar(sizeof...(tail)? ' ':'\n');W(tail...);}};
#define prec setprecision
namespace vh{typedef long long ll;typedef unsigned long long llu;template<typename T>T gcd(T m,T n){while(n){T t=m%n;m=n;n=t;};return m;}template<typename T>T exgcd(T a,T b,T&sa,T&ta){T q,r,sb=0,tb=1,sc,tc;sa=1,ta=0;if(b)do q=a/b,r=a-q*b,a=b,b=r,sc=sa-q*sb,sa=sb,sb=sc,tc=ta-q*tb,ta=tb,tb=tc;while(b);return a;}template<typename T>T mul_inv(T a,T b){T t1=a,t2=b,t3;T v1=1,v2=0,v3;T x;while(t2!=1)x=t1/t2,t3=t1-x*t2,v3=v1-x*v2,t1=t2,t2=t3,v1=v2,v2=v3;return(v2+b)%b;}template<typename T>T powmod(T a,T b,T MOD){if(b<0)return 0;T rv=1;while(b)(b%2)&&(rv=(rv*a)%MOD),a=a*a%MOD,b/=2;return rv;}template<ll n>struct BitSize{enum{Size=BitSize<n/2>::Size+1};};template<>struct BitSize<0>{enum{Size=1};};template<>struct BitSize<1>{enum{Size=1};};
#define BITSIZE(n) (BitSize<n>::Size)
#define BITMAX(n) (BitSize<n>::Size - 1)
#define DEBUG !defined(ONLINE_JUDGE)
#define SZ(x) ((int)(x).size())
#define ALL(x) begin(x), end(x)
template<typename TH>void _dbg(const char*sdbg,TH h){cerr<<sdbg<<"="<<h<<"\n";}template<typename TH,typename... TA>void _dbg(const char*sdbg,TH h,TA... t){while(*sdbg!=',')cerr<<*sdbg++;cerr<<"="<<h<<",";_dbg(sdbg+1,t...);}
#ifdef DEBUG
#define debug(...) _dbg(#__VA_ARGS__, __VA_ARGS__)
#define debugv(x) {{cerr <<#x <<" = "; for(auto itt: x) cerr <<*itt <<", "; cerr <<"\n"; }}
#else
#define debug(...) (__VA_ARGS__)
#define debugv(x)
#define cerr if(0)cout
#endif
}namespace vh{template<typename T>int min_rotation(vector<T>s){int a=0,N=s.size();for(int b=0;b<N;b++)for(int i=0;i<N;i++){if(a+i==b||s[(a+i)%N]<s[(b+i)%N]){b+=max(0,i-1);break;}if(s[(a+i)%N]>s[(b+i)%N]){a=b;break;}}return a;}}namespace vh{};
namespace vh{
  const int maxn=363363;
  const ll maxx=308983066;
  const ll MOD=1e9+7;
  set<ll>possible_buy;
  map<ll,int>remains;
  set<ll,greater<ll>>possible_sell;
  int n;
  ll values[maxn];
  bool is_add[maxn];
  int main(){
    srand(GRANDOM);
    cin>>n;
    ll r=1;
    auto remove_buy=[&](ll x){
        vector<ll>to_remove;
        for(auto v:possible_buy){
          if(v>=x)break;
          to_remove.push_back(v);
        }
        if(!to_remove.empty())for(auto v:to_remove){
          possible_buy.erase(v);
          if(--remains[v]==0)r=0;
        }
    };
    auto remove_sell=[&](ll x){
        vector<ll>to_remove;
        for(auto v:possible_sell){
          if(v<=x)break;
          to_remove.push_back(v);
        }
        if(!to_remove.empty())for(auto v:to_remove){
          possible_sell.erase(v);
          if(--remains[v]==0)r=0;
        }
    };
    auto remove_buy_rev=[&](ll x){
        vector<ll>to_remove;
        for(auto it=possible_buy.rbegin(),ite=possible_buy.rend();it!=ite;it++){
          auto v=*it;
          if(v<=x)break;
          to_remove.push_back(v);
        }
        if(!to_remove.empty())for(auto v:to_remove){
          possible_buy.erase(v);
          if(--remains[v]==0)r=0;
        }
    };
    auto remove_sell_rev=[&](ll x){
        vector<ll>to_remove;
        for(auto it=possible_sell.rbegin(),ite=possible_sell.rend();it!=ite;it++){
          auto v=*it;
          if(v>=x)break;
          to_remove.push_back(v);
        }
        if(!to_remove.empty())for(auto v:to_remove){
          possible_sell.erase(v);
          if(--remains[v]==0)r=0;
        }
    };
    ll possible_min=1;
    ll possible_max=maxx;
    for(int i=1;i<=n;i++){
      ll&x=values[i];
      char s[20];cin>>s>>x;
      is_add[i]=(s[1]=='D');
      if(!is_add[i]){
        if(
          possible_buy.find(x)==possible_buy.end()
          &&possible_sell.find(x)==possible_sell.end()
        ){
          r=0;break;
        }
        ll rr=0;
        if(possible_buy.find(x)!=possible_buy.end())possible_buy.erase(x),rr++;
        if(possible_sell.find(x)!=possible_sell.end())possible_sell.erase(x),rr++;
        r=(r*rr)%MOD;
        remains.erase(x);
        remove_buy_rev(x);
        remove_sell_rev(x);
      }else{
        if(possible_buy.find(x)!=possible_buy.end()||possible_sell.find(x)!=possible_sell.end()){
          r=0;break;
        }
        possible_buy.insert(x);
        possible_sell.insert(x);
        remains[x]=2;
      }
    }
    if(r){
      for(auto x:remains){
          ll rr=0;
          if(possible_buy.find(x.first)!=possible_buy.end())rr++;
          if(possible_sell.find(x.first)!=possible_sell.end())rr++;
          r=(r*rr)%MOD;
      }
    }
    cout<<r<<endl;
    return 0;
  }
};
int main(int argc,char*argv[]){
  std::cin.sync_with_stdio(false);std::cin.tie(nullptr);
  return vh::main();
}


#pragma GCC optimize("O3")
#ifdef ONLINE_JUDGE
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#endif
#pragma GCC optimize("unroll-loops")
#pragma comment(linker, "/stack:200000000")
#include <bits/stdc++.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>
template<typename Key=int,typename Mapped=__gnu_pbds::null_type,typename Cmp_Fn=std::less<Key>,typename Tag=__gnu_pbds::rb_tree_tag,template<typename Const_Node_Iterator,typename Node_Iterator,typename Cmp_Fn_,typename Allocator_>class Node_Update=__gnu_pbds::tree_order_statistics_node_update,typename Allocator=std::allocator<char>>class ordered_set_t:__gnu_pbds::tree<Key,Mapped,Cmp_Fn,Tag,Node_Update,Allocator>{};const int GRANDOM=std::chrono::high_resolution_clock::now().time_since_epoch().count();struct ghash{int operator()(int x){return std::hash<int>{}(x^GRANDOM);}};template<typename KeyType>class hash_table_t:__gnu_pbds::gp_hash_table<KeyType,int,ghash>{};namespace vh{template<class T>void _R(T&x){std::cin>>x;}inline void _R(int&x){scanf("%d",&x);}inline void _R(int64_t&x){scanf("%" SCNd64,&x);}inline void _R(double&x){scanf("%lf",&x);}inline void _R(char&x){scanf("%c",&x);}inline void _R(char*x){scanf("%s",x);}inline void R(){}template<class T,class... U>inline void R(T&head,U&... tail){_R(head);R(tail...);}template<class T>void _W(const T&x){cout<<x;}inline void _W(const int&x){printf("%d",x);}inline void _W(const int64_t&x){printf("%" PRId64,x);}inline void _W(const double&x){printf("%.16f",x);}inline void _W(const char&x){putchar(x);}inline void _W(const char*x){printf("%s",x);}template<class T>inline void _W(const vector<T>&x){for(auto i=x.begin();i!=x.end();_W(*i++))if(i!=x.cbegin())putchar(' ');}inline void W(){}template<class T,class... U>inline void W(const T&head,const U&... tail){_W(head);if(sizeof...(tail))putchar(' '),W(tail...);}template<class T,class... U>inline void WL(const T&head,const U&... tail){_W(head);putchar(sizeof...(tail)? ' ':'\n');W(tail...);}};
#define prec setprecision
namespace vh{typedef long long ll;typedef unsigned long long llu;template<typename T>T gcd(T m,T n){while(n){T t=m%n;m=n;n=t;};return m;}template<typename T>T exgcd(T a,T b,T&sa,T&ta){T q,r,sb=0,tb=1,sc,tc;sa=1,ta=0;if(b)do q=a/b,r=a-q*b,a=b,b=r,sc=sa-q*sb,sa=sb,sb=sc,tc=ta-q*tb,ta=tb,tb=tc;while(b);return a;}template<typename T>T mul_inv(T a,T b){T t1=a,t2=b,t3;T v1=1,v2=0,v3;T x;while(t2!=1)x=t1/t2,t3=t1-x*t2,v3=v1-x*v2,t1=t2,t2=t3,v1=v2,v2=v3;return(v2+b)%b;}template<typename T>T powmod(T a,T b,T MOD){if(b<0)return 0;T rv=1;while(b)(b%2)&&(rv=(rv*a)%MOD),a=a*a%MOD,b/=2;return rv;}template<ll n>struct BitSize{enum{Size=BitSize<n/2>::Size+1};};template<>struct BitSize<0>{enum{Size=1};};template<>struct BitSize<1>{enum{Size=1};};
#define BITSIZE(n) (BitSize<n>::Size)
#define BITMAX(n) (BitSize<n>::Size - 1)
#define DEBUG !defined(ONLINE_JUDGE)
#define SZ(x) ((int)(x).size())
#define ALL(x) begin(x), end(x)
template<typename TH>void _dbg(const char*sdbg,TH h){cerr<<sdbg<<"="<<h<<"\n";}template<typename TH,typename... TA>void _dbg(const char*sdbg,TH h,TA... t){while(*sdbg!=',')cerr<<*sdbg++;cerr<<"="<<h<<",";_dbg(sdbg+1,t...);}
#ifdef DEBUG
#define debug(...) _dbg(#__VA_ARGS__, __VA_ARGS__)
#define debugv(x) {{cerr <<#x <<" = "; for(auto itt: x) cerr <<*itt <<", "; cerr <<"\n"; }}
#else
#define debug(...) (__VA_ARGS__)
#define debugv(x)
#define cerr if(0)cout
#endif
}namespace vh{template<typename T>int min_rotation(vector<T>s){int a=0,N=s.size();for(int b=0;b<N;b++)for(int i=0;i<N;i++){if(a+i==b||s[(a+i)%N]<s[(b+i)%N]){b+=max(0,i-1);break;}if(s[(a+i)%N]>s[(b+i)%N]){a=b;break;}}return a;}}namespace vh{};
namespace vh{
  const int maxn=363363;
  const ll maxx=308983066;
  const ll MOD=1e9+7;
  set<ll>possible_buy;
  map<ll,int>remains;
  set<ll,greater<ll>>possible_sell;
  int n;
  ll values[maxn];
  bool is_add[maxn];
  int main(){
    srand(GRANDOM);
    cin>>n;
    ll r=1;
    auto remove_buy=[&](ll x){
        vector<ll>to_remove;
        for(auto v:possible_buy){
          if(v>=x)break;
          to_remove.push_back(v);
        }
        if(!to_remove.empty())for(auto v:to_remove){
          possible_buy.erase(v);
          if(--remains[v]==0)r=0;
        }
    };
    auto remove_sell=[&](ll x){
        vector<ll>to_remove;
        for(auto v:possible_sell){
          if(v<=x)break;
          to_remove.push_back(v);
        }
        if(!to_remove.empty())for(auto v:to_remove){
          possible_sell.erase(v);
          if(--remains[v]==0)r=0;
        }
    };
    auto remove_buy_rev=[&](ll x){
        vector<ll>to_remove;
        for(auto it=possible_buy.rbegin(),ite=possible_buy.rend();it!=ite;it++){
          auto v=*it;
          if(v<=x)break;
          to_remove.push_back(v);
        }
        if(!to_remove.empty())for(auto v:to_remove){
          possible_buy.erase(v);
          if(--remains[v]==0)r=0;
        }
    };
    auto remove_sell_rev=[&](ll x){
        vector<ll>to_remove;
        for(auto it=possible_sell.rbegin(),ite=possible_sell.rend();it!=ite;it++){
          auto v=*it;
          if(v>=x)break;
          to_remove.push_back(v);
        }
        if(!to_remove.empty())for(auto v:to_remove){
          possible_sell.erase(v);
          if(--remains[v]==0)r=0;
        }
    };
    ll possible_min=1;
    ll possible_max=maxx;
    for(int i=1;i<=n;i++){
      ll&x=values[i];
      char s[20];cin>>s>>x;
      is_add[i]=(s[1]=='D');
      if(!is_add[i]){
        if(
          possible_buy.find(x)==possible_buy.end()
          &&possible_sell.find(x)==possible_sell.end()
        ){
          r=0;break;
        }
        ll rr=0;
        if(possible_buy.find(x)!=possible_buy.end())possible_buy.erase(x),rr++;
        if(possible_sell.find(x)!=possible_sell.end())possible_sell.erase(x),rr++;
        r=(r*rr)%MOD;
        remains.erase(x);
        remove_buy_rev(x);
        remove_sell_rev(x);
      }else{
        if(possible_buy.find(x)!=possible_buy.end()||possible_sell.find(x)!=possible_sell.end()){
          r=0;break;
        }
        possible_buy.insert(x);
        possible_sell.insert(x);
        remains[x]=2;
      }
    }
    if(r&&remains.size()){
      for(auto x:remains){
          ll rr=0;
          if(possible_buy.find(x.first)!=possible_buy.end())rr++;
          if(possible_sell.find(x.first)!=possible_sell.end())rr++;
          if(rr==0){r=0;break;}
      }
      ll nLeft=0;
      for(auto x:remains){
        if(possible_buy.find(x.first)!=possible_buy.end())nLeft++;
        else break;
      }
      ll total=remains.size();
      ll nRight=total+1;
      for(auto it=remains.rbegin(),ite=remains.rend();it!=ite;it++){
        auto x=it->first;
        if(possible_sell.find(x)!=possible_sell.end())nRight--;
        else break;
      }
      nRight--;
      debug(nLeft,nRight,total);
      if(nRight<=nLeft){
        r=(r*(nLeft-nRight+1)%MOD);
      }else{
        r=0;
      }
    }
    cout<<r<<endl;
    return 0;
  }
};
int main(int argc,char*argv[]){
  std::cin.sync_with_stdio(false);std::cin.tie(nullptr);
  return vh::main();
}


#pragma GCC optimize("O3")
#ifdef ONLINE_JUDGE
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#endif
#pragma GCC optimize("unroll-loops")
#pragma comment(linker, "/stack:200000000")
#include <bits/stdc++.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>
template<typename Key=int,typename Mapped=__gnu_pbds::null_type,typename Cmp_Fn=std::less<Key>,typename Tag=__gnu_pbds::rb_tree_tag,template<typename Const_Node_Iterator,typename Node_Iterator,typename Cmp_Fn_,typename Allocator_>class Node_Update=__gnu_pbds::tree_order_statistics_node_update,typename Allocator=std::allocator<char>>class ordered_set_t:__gnu_pbds::tree<Key,Mapped,Cmp_Fn,Tag,Node_Update,Allocator>{};const int GRANDOM=std::chrono::high_resolution_clock::now().time_since_epoch().count();struct ghash{int operator()(int x){return std::hash<int>{}(x^GRANDOM);}};template<typename KeyType>class hash_table_t:__gnu_pbds::gp_hash_table<KeyType,int,ghash>{};namespace vh{template<class T>void _R(T&x){std::cin>>x;}inline void _R(int&x){scanf("%d",&x);}inline void _R(int64_t&x){scanf("%" SCNd64,&x);}inline void _R(double&x){scanf("%lf",&x);}inline void _R(char&x){scanf("%c",&x);}inline void _R(char*x){scanf("%s",x);}inline void R(){}template<class T,class... U>inline void R(T&head,U&... tail){_R(head);R(tail...);}template<class T>void _W(const T&x){cout<<x;}inline void _W(const int&x){printf("%d",x);}inline void _W(const int64_t&x){printf("%" PRId64,x);}inline void _W(const double&x){printf("%.16f",x);}inline void _W(const char&x){putchar(x);}inline void _W(const char*x){printf("%s",x);}template<class T>inline void _W(const vector<T>&x){for(auto i=x.begin();i!=x.end();_W(*i++))if(i!=x.cbegin())putchar(' ');}inline void W(){}template<class T,class... U>inline void W(const T&head,const U&... tail){_W(head);if(sizeof...(tail))putchar(' '),W(tail...);}template<class T,class... U>inline void WL(const T&head,const U&... tail){_W(head);putchar(sizeof...(tail)? ' ':'\n');W(tail...);}};
#define prec setprecision
namespace vh{typedef long long ll;typedef unsigned long long llu;template<typename T>T gcd(T m,T n){while(n){T t=m%n;m=n;n=t;};return m;}template<typename T>T exgcd(T a,T b,T&sa,T&ta){T q,r,sb=0,tb=1,sc,tc;sa=1,ta=0;if(b)do q=a/b,r=a-q*b,a=b,b=r,sc=sa-q*sb,sa=sb,sb=sc,tc=ta-q*tb,ta=tb,tb=tc;while(b);return a;}template<typename T>T mul_inv(T a,T b){T t1=a,t2=b,t3;T v1=1,v2=0,v3;T x;while(t2!=1)x=t1/t2,t3=t1-x*t2,v3=v1-x*v2,t1=t2,t2=t3,v1=v2,v2=v3;return(v2+b)%b;}template<typename T>T powmod(T a,T b,T MOD){if(b<0)return 0;T rv=1;while(b)(b%2)&&(rv=(rv*a)%MOD),a=a*a%MOD,b/=2;return rv;}template<ll n>struct BitSize{enum{Size=BitSize<n/2>::Size+1};};template<>struct BitSize<0>{enum{Size=1};};template<>struct BitSize<1>{enum{Size=1};};
#define BITSIZE(n) (BitSize<n>::Size)
#define BITMAX(n) (BitSize<n>::Size - 1)
#define DEBUG !defined(ONLINE_JUDGE)
#define SZ(x) ((int)(x).size())
#define ALL(x) begin(x), end(x)
template<typename TH>void _dbg(const char*sdbg,TH h){cerr<<sdbg<<"="<<h<<"\n";}template<typename TH,typename... TA>void _dbg(const char*sdbg,TH h,TA... t){while(*sdbg!=',')cerr<<*sdbg++;cerr<<"="<<h<<",";_dbg(sdbg+1,t...);}
#ifdef DEBUG
#define debug(...) _dbg(#__VA_ARGS__, __VA_ARGS__)
#define debugv(x) {{cerr <<#x <<" = "; for(auto itt: x) cerr <<*itt <<", "; cerr <<"\n"; }}
#else
#define debug(...) (__VA_ARGS__)
#define debugv(x)
#define cerr if(0)cout
#endif
}namespace vh{template<typename T>int min_rotation(vector<T>s){int a=0,N=s.size();for(int b=0;b<N;b++)for(int i=0;i<N;i++){if(a+i==b||s[(a+i)%N]<s[(b+i)%N]){b+=max(0,i-1);break;}if(s[(a+i)%N]>s[(b+i)%N]){a=b;break;}}return a;}}namespace vh{};
namespace vh{
  const int maxn=363363;
  const ll MOD=1e9+7;
  set<int>possible_buy;
  set<int>remains;
  set<int,greater<int>>possible_sell;
  int n;
  ll values[maxn];
  bool is_add[maxn];
  int main(){
    srand(GRANDOM);
    cin>>n;
    ll r=1;
    for(int i=1;i<=n;i++){
      ll&x=values[i];
      char s[20];cin>>s>>x;
      is_add[i]=(s[1]=='D');
      if(!is_add[i]){
        vector<ll>to_remove;
        for(auto v:possible_buy){
          if(v>=x)break;
          to_remove.push_back(v);
        }
        if(!to_remove.empty())for(auto v:to_remove){
          possible_buy.erase(v);
        }
        to_remove.clear();
        for(auto v:possible_sell){
          if(v<=x)break;
          to_remove.push_back(v);
        }
        if(!to_remove.empty())for(auto v:to_remove){
          possible_sell.erase(v);
        }
        ll rr=0;
        if(possible_buy.find(x)!=possible_buy.end())rr++;
        if(possible_sell.find(x)!=possible_sell.end())rr++;
        r=(r*rr)%MOD;
        possible_buy.erase(x);
        possible_sell.erase(x);
        remains.erase(x);
      }else{
        possible_buy.insert(x);
        possible_sell.insert(x);
        remains.insert(x);
      }
    }
    for(auto x:remains){
        ll rr=0;
        if(possible_buy.find(x)!=possible_buy.end())rr++;
        if(possible_sell.find(x)!=possible_sell.end())rr++;
        r=(r*rr)%MOD;
    }
    cout<<r<<endl;
    return 0;
  }
};
int main(int argc,char*argv[]){
  std::cin.sync_with_stdio(false);std::cin.tie(nullptr);
  return vh::main();
}


#pragma GCC optimize("O3")
#ifdef ONLINE_JUDGE
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#endif
#pragma GCC optimize("unroll-loops")
#pragma comment(linker, "/stack:200000000")
#include <bits/stdc++.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>
template<typename Key=int,typename Mapped=__gnu_pbds::null_type,typename Cmp_Fn=std::less<Key>,typename Tag=__gnu_pbds::rb_tree_tag,template<typename Const_Node_Iterator,typename Node_Iterator,typename Cmp_Fn_,typename Allocator_>class Node_Update=__gnu_pbds::tree_order_statistics_node_update,typename Allocator=std::allocator<char>>class ordered_set_t:__gnu_pbds::tree<Key,Mapped,Cmp_Fn,Tag,Node_Update,Allocator>{};const int GRANDOM=std::chrono::high_resolution_clock::now().time_since_epoch().count();struct ghash{int operator()(int x){return std::hash<int>{}(x^GRANDOM);}};template<typename KeyType>class hash_table_t:__gnu_pbds::gp_hash_table<KeyType,int,ghash>{};namespace vh{template<class T>void _R(T&x){std::cin>>x;}inline void _R(int&x){scanf("%d",&x);}inline void _R(int64_t&x){scanf("%" SCNd64,&x);}inline void _R(double&x){scanf("%lf",&x);}inline void _R(char&x){scanf("%c",&x);}inline void _R(char*x){scanf("%s",x);}inline void R(){}template<class T,class... U>inline void R(T&head,U&... tail){_R(head);R(tail...);}template<class T>void _W(const T&x){cout<<x;}inline void _W(const int&x){printf("%d",x);}inline void _W(const int64_t&x){printf("%" PRId64,x);}inline void _W(const double&x){printf("%.16f",x);}inline void _W(const char&x){putchar(x);}inline void _W(const char*x){printf("%s",x);}template<class T>inline void _W(const vector<T>&x){for(auto i=x.begin();i!=x.end();_W(*i++))if(i!=x.cbegin())putchar(' ');}inline void W(){}template<class T,class... U>inline void W(const T&head,const U&... tail){_W(head);if(sizeof...(tail))putchar(' '),W(tail...);}template<class T,class... U>inline void WL(const T&head,const U&... tail){_W(head);putchar(sizeof...(tail)? ' ':'\n');W(tail...);}};
#define prec setprecision
namespace vh{typedef long long ll;typedef unsigned long long llu;template<typename T>T gcd(T m,T n){while(n){T t=m%n;m=n;n=t;};return m;}template<typename T>T exgcd(T a,T b,T&sa,T&ta){T q,r,sb=0,tb=1,sc,tc;sa=1,ta=0;if(b)do q=a/b,r=a-q*b,a=b,b=r,sc=sa-q*sb,sa=sb,sb=sc,tc=ta-q*tb,ta=tb,tb=tc;while(b);return a;}template<typename T>T mul_inv(T a,T b){T t1=a,t2=b,t3;T v1=1,v2=0,v3;T x;while(t2!=1)x=t1/t2,t3=t1-x*t2,v3=v1-x*v2,t1=t2,t2=t3,v1=v2,v2=v3;return(v2+b)%b;}template<typename T>T powmod(T a,T b,T MOD){if(b<0)return 0;T rv=1;while(b)(b%2)&&(rv=(rv*a)%MOD),a=a*a%MOD,b/=2;return rv;}template<ll n>struct BitSize{enum{Size=BitSize<n/2>::Size+1};};template<>struct BitSize<0>{enum{Size=1};};template<>struct BitSize<1>{enum{Size=1};};
#define BITSIZE(n) (BitSize<n>::Size)
#define BITMAX(n) (BitSize<n>::Size - 1)
#define DEBUG !defined(ONLINE_JUDGE)
#define SZ(x) ((int)(x).size())
#define ALL(x) begin(x), end(x)
template<typename TH>void _dbg(const char*sdbg,TH h){cerr<<sdbg<<"="<<h<<"\n";}template<typename TH,typename... TA>void _dbg(const char*sdbg,TH h,TA... t){while(*sdbg!=',')cerr<<*sdbg++;cerr<<"="<<h<<",";_dbg(sdbg+1,t...);}
#ifdef DEBUG
#define debug(...) _dbg(#__VA_ARGS__, __VA_ARGS__)
#define debugv(x) {{cerr <<#x <<" = "; for(auto itt: x) cerr <<*itt <<", "; cerr <<"\n"; }}
#else
#define debug(...) (__VA_ARGS__)
#define debugv(x)
#define cerr if(0)cout
#endif
}namespace vh{template<typename T>int min_rotation(vector<T>s){int a=0,N=s.size();for(int b=0;b<N;b++)for(int i=0;i<N;i++){if(a+i==b||s[(a+i)%N]<s[(b+i)%N]){b+=max(0,i-1);break;}if(s[(a+i)%N]>s[(b+i)%N]){a=b;break;}}return a;}}namespace vh{};
namespace vh{
  const int maxn=363363;
  const ll maxx=308983066;
  const ll MOD=1e9+7;
  set<ll>possible_buy;
  map<ll,int>remains;
  set<ll,greater<ll>>possible_sell;
  int n;
  ll values[maxn];
  bool is_add[maxn];
  int main(){
    srand(GRANDOM);
    cin>>n;
    ll r=1;
    auto remove_buy=[&](ll x){
        vector<ll>to_remove;
        for(auto v:possible_buy){
          if(v>=x)break;
          to_remove.push_back(v);
        }
        if(!to_remove.empty())for(auto v:to_remove){
          possible_buy.erase(v);
          if(--remains[v]==0)r=0;
        }
    };
    auto remove_sell=[&](ll x){
        vector<ll>to_remove;
        for(auto v:possible_sell){
          if(v<=x)break;
          to_remove.push_back(v);
        }
        if(!to_remove.empty())for(auto v:to_remove){
          possible_sell.erase(v);
          if(--remains[v]==0)r=0;
        }
    };
    ll possible_min=1;
    ll possible_max=maxx;
    for(int i=1;i<=n;i++){
      ll&x=values[i];
      char s[20];cin>>s>>x;
      is_add[i]=(s[1]=='D');
      if(!is_add[i]){
        if(
          possible_buy.find(x)==possible_buy.end()
          &&possible_sell.find(x)==possible_sell.end()
        ){
          r=0;break;
        }
        ll rr=0;
        if(possible_buy.find(x)!=possible_buy.end())possible_buy.erase(x),rr++;
        if(possible_sell.find(x)!=possible_sell.end())possible_sell.erase(x),rr++;
        r=(r*rr)%MOD;
        possible_buy.erase(x);
        possible_sell.erase(x);
        remains.erase(x);
        remove_buy(x);
        remove_sell(x);
      }else{
        if(possible_buy.find(x)!=possible_buy.end()||possible_sell.find(x)!=possible_sell.end()){
          r=0;break;
        }
        possible_buy.insert(x);
        possible_sell.insert(x);
        remains[x]=2;
        auto it=remains.find(x),it2=it;
        if(it!=remains.begin()){
          it--;
          if(it!=remains.begin()){
            it--;
            remove_buy(it->first+1);
          }
        }
        it=remains.find(x);
        it++;
        if(it!=remains.end()){
          it++;
          if(it!=remains.end()){
            remove_sell(it->first-1);
          }
        }
      }
    }
    if(r){
      for(auto x:remains){
          ll rr=0;
          if(possible_buy.find(x.first)!=possible_buy.end())rr++;
          if(possible_sell.find(x.first)!=possible_sell.end())rr++;
          r=(r*rr)%MOD;
      }
    }
    cout<<r<<endl;
    return 0;
  }
};
int main(int argc,char*argv[]){
  std::cin.sync_with_stdio(false);std::cin.tie(nullptr);
  return vh::main();
}


#pragma GCC optimize("O3")
#ifdef ONLINE_JUDGE
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#endif
#pragma GCC optimize("unroll-loops")
#pragma comment(linker, "/stack:200000000")
#include <bits/stdc++.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>
template<typename Key=int,typename Mapped=__gnu_pbds::null_type,typename Cmp_Fn=std::less<Key>,typename Tag=__gnu_pbds::rb_tree_tag,template<typename Const_Node_Iterator,typename Node_Iterator,typename Cmp_Fn_,typename Allocator_>class Node_Update=__gnu_pbds::tree_order_statistics_node_update,typename Allocator=std::allocator<char>>class ordered_set_t:__gnu_pbds::tree<Key,Mapped,Cmp_Fn,Tag,Node_Update,Allocator>{};const int GRANDOM=std::chrono::high_resolution_clock::now().time_since_epoch().count();struct ghash{int operator()(int x){return std::hash<int>{}(x^GRANDOM);}};template<typename KeyType>class hash_table_t:__gnu_pbds::gp_hash_table<KeyType,int,ghash>{};namespace vh{template<class T>void _R(T&x){std::cin>>x;}inline void _R(int&x){scanf("%d",&x);}inline void _R(int64_t&x){scanf("%" SCNd64,&x);}inline void _R(double&x){scanf("%lf",&x);}inline void _R(char&x){scanf("%c",&x);}inline void _R(char*x){scanf("%s",x);}inline void R(){}template<class T,class... U>inline void R(T&head,U&... tail){_R(head);R(tail...);}template<class T>void _W(const T&x){cout<<x;}inline void _W(const int&x){printf("%d",x);}inline void _W(const int64_t&x){printf("%" PRId64,x);}inline void _W(const double&x){printf("%.16f",x);}inline void _W(const char&x){putchar(x);}inline void _W(const char*x){printf("%s",x);}template<class T>inline void _W(const vector<T>&x){for(auto i=x.begin();i!=x.end();_W(*i++))if(i!=x.cbegin())putchar(' ');}inline void W(){}template<class T,class... U>inline void W(const T&head,const U&... tail){_W(head);if(sizeof...(tail))putchar(' '),W(tail...);}template<class T,class... U>inline void WL(const T&head,const U&... tail){_W(head);putchar(sizeof...(tail)? ' ':'\n');W(tail...);}};
#define prec setprecision
namespace vh{typedef long long ll;typedef unsigned long long llu;template<typename T>T gcd(T m,T n){while(n){T t=m%n;m=n;n=t;};return m;}template<typename T>T exgcd(T a,T b,T&sa,T&ta){T q,r,sb=0,tb=1,sc,tc;sa=1,ta=0;if(b)do q=a/b,r=a-q*b,a=b,b=r,sc=sa-q*sb,sa=sb,sb=sc,tc=ta-q*tb,ta=tb,tb=tc;while(b);return a;}template<typename T>T mul_inv(T a,T b){T t1=a,t2=b,t3;T v1=1,v2=0,v3;T x;while(t2!=1)x=t1/t2,t3=t1-x*t2,v3=v1-x*v2,t1=t2,t2=t3,v1=v2,v2=v3;return(v2+b)%b;}template<typename T>T powmod(T a,T b,T MOD){if(b<0)return 0;T rv=1;while(b)(b%2)&&(rv=(rv*a)%MOD),a=a*a%MOD,b/=2;return rv;}template<ll n>struct BitSize{enum{Size=BitSize<n/2>::Size+1};};template<>struct BitSize<0>{enum{Size=1};};template<>struct BitSize<1>{enum{Size=1};};
#define BITSIZE(n) (BitSize<n>::Size)
#define BITMAX(n) (BitSize<n>::Size - 1)
#define DEBUG !defined(ONLINE_JUDGE)
#define SZ(x) ((int)(x).size())
#define ALL(x) begin(x), end(x)
template<typename TH>void _dbg(const char*sdbg,TH h){cerr<<sdbg<<"="<<h<<"\n";}template<typename TH,typename... TA>void _dbg(const char*sdbg,TH h,TA... t){while(*sdbg!=',')cerr<<*sdbg++;cerr<<"="<<h<<",";_dbg(sdbg+1,t...);}
#ifdef DEBUG
#define debug(...) _dbg(#__VA_ARGS__, __VA_ARGS__)
#define debugv(x) {{cerr <<#x <<" = "; for(auto itt: x) cerr <<*itt <<", "; cerr <<"\n"; }}
#else
#define debug(...) (__VA_ARGS__)
#define debugv(x)
#define cerr if(0)cout
#endif
}namespace vh{template<typename T>int min_rotation(vector<T>s){int a=0,N=s.size();for(int b=0;b<N;b++)for(int i=0;i<N;i++){if(a+i==b||s[(a+i)%N]<s[(b+i)%N]){b+=max(0,i-1);break;}if(s[(a+i)%N]>s[(b+i)%N]){a=b;break;}}return a;}}namespace vh{};
namespace vh{
  const int maxn=363363;
  const ll maxx=308983066;
  const ll MOD=1e9+7;
  set<ll>possible_buy;
  map<ll,int>remains;
  set<ll,greater<ll>>possible_sell;
  int n;
  ll values[maxn];
  bool is_add[maxn];
  int main(){
    srand(GRANDOM);
    cin>>n;
    ll r=1;
    auto remove_buy=[&](ll x){
        vector<ll>to_remove;
        for(auto v:possible_buy){
          if(v>=x)break;
          to_remove.push_back(v);
        }
        if(!to_remove.empty())for(auto v:to_remove){
          possible_buy.erase(v);
          if(--remains[v]==0)r=0;
        }
    };
    auto remove_sell=[&](ll x){
        vector<ll>to_remove;
        for(auto v:possible_sell){
          if(v<=x)break;
          to_remove.push_back(v);
        }
        if(!to_remove.empty())for(auto v:to_remove){
          possible_sell.erase(v);
          if(--remains[v]==0)r=0;
        }
    };
    auto remove_buy_rev=[&](ll x){
        vector<ll>to_remove;
        for(auto it=possible_buy.rbegin(),ite=possible_buy.rend();it!=ite;it++){
          auto v=*it;
          if(v<=x)break;
          to_remove.push_back(v);
        }
        if(!to_remove.empty())for(auto v:to_remove){
          possible_buy.erase(v);
          if(--remains[v]==0)r=0;
        }
    };
    auto remove_sell_rev=[&](ll x){
        vector<ll>to_remove;
        for(auto it=possible_sell.rbegin(),ite=possible_sell.rend();it!=ite;it++){
          auto v=*it;
          if(v>=x)break;
          to_remove.push_back(v);
        }
        if(!to_remove.empty())for(auto v:to_remove){
          possible_sell.erase(v);
          if(--remains[v]==0)r=0;
        }
    };
    ll possible_min=1;
    ll possible_max=maxx;
    for(int i=1;i<=n;i++){
      ll&x=values[i];
      char s[20];cin>>s>>x;
      is_add[i]=(s[1]=='D');
      if(!is_add[i]){
        if(
          possible_buy.find(x)==possible_buy.end()
          &&possible_sell.find(x)==possible_sell.end()
        ){
          r=0;break;
        }
        ll rr=0;
        if(possible_buy.find(x)!=possible_buy.end())possible_buy.erase(x),rr++;
        if(possible_sell.find(x)!=possible_sell.end())possible_sell.erase(x),rr++;
        r=(r*rr)%MOD;
        remains.erase(x);
        remove_buy_rev(x);
        remove_sell_rev(x);
      }else{
        if(possible_buy.find(x)!=possible_buy.end()||possible_sell.find(x)!=possible_sell.end()){
          r=0;break;
        }
        possible_buy.insert(x);
        possible_sell.insert(x);
        remains[x]=2;
      }
    }
    if(r){
      for(auto x:remains){
          ll rr=0;
          if(possible_buy.find(x.first)!=possible_buy.end())rr++;
          if(possible_sell.find(x.first)!=possible_sell.end())rr++;
          if(rr==0){r=0;break;}
      }
      ll nLeft=0;
      for(auto x:remains){
        if(possible_buy.find(x.first)!=possible_buy.end())nLeft++;
        else break;
      }
      ll total=remains.size();
      ll nRight=total+1;
      for(auto it=remains.rbegin(),ite=remains.rend();it!=ite;it++){
        auto x=it->first;
        if(possible_sell.find(x)!=possible_sell.end())nRight--;
        else break;
      }
      debug(nLeft,nRight);
      if(nRight<=nLeft){
        r=(r*(nLeft-nRight+1)%MOD);
      }
    }
    cout<<r<<endl;
    return 0;
  }
};
int main(int argc,char*argv[]){
  std::cin.sync_with_stdio(false);std::cin.tie(nullptr);
  return vh::main();
}


#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <string>
#include <vector>
#include <queue>
using namespace std;

int n;
char ch[15];

long long mod=1e9+7;

struct node1
{
    long long v;
    friend bool operator<(node1 a,node1 b)
    {
        return a.v<b.v;
    }
};

struct node2
{
    long long v;
    friend bool operator<(node2 a,node2 b)
    {
        return a.v>b.v;
    }
};

long long powd(long long a,long long b)
{
    long long ans=1;
    while(b>0)
    {
        if(b%2==1)
            ans=ans*a%mod;
        a=a*a%mod;
        b/=2;
    }
    return ans;
}

int main() {

    while(~scanf("%d",&n))
    {
        long long ans=1;
        long long av=powd(2,mod-2);

        priority_queue<node1> q1;//big down
        priority_queue<node1> q3;//big
        priority_queue<node2> q2;//small up
        while(n--)
        {
            scanf("%s",ch);
            long long tp;
            scanf("%lld",&tp);

            if(ch[1]=='D')
            {
                if((!q2.empty()) && (tp>q2.top().v))
                {
                    node2 cur;cur.v=tp;
                    q2.push(cur);
                }
                else if((!q1.empty()) && (tp<q1.top().v))
                {
                    node1 cur;cur.v=tp;
                    q1.push(cur);
                }
                else
                {
                    node1 cur;cur.v=tp;
                    q3.push(cur);
                    //ans=ans*2%mod;
                }
            } else
            {
                if((!q2.empty()) && (tp>=q2.top().v))
                {
                    if(tp==q2.top().v)
                        q2.pop();
                    else
                        ans=0;
                }
                else if((!q1.empty()) && (tp<=q1.top().v))
                {
                    if(tp==q1.top().v)
                        q1.pop();
                    else
                        ans=0;
                }
                else
                {
                    ans=ans*2%mod;
                    while(!q3.empty())
                    {
                        node1 cur1=q3.top();q3.pop();
                        node2 cur2;cur2.v=cur1.v;
                        //ans=ans*av%mod;
                        if(cur2.v>tp)
                            q2.push(cur2);
                        else if(cur1.v<tp)
                            q1.push(cur1);
                    }
                }
            }
        }
        if(!q3.empty())
            ans=ans*1ll*(q3.size()+1)%mod;

        printf("%lld\n",ans);
    }
    return 0;
}


#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <string>
#include <vector>
#include <queue>
using namespace std;

int n;
char ch[15];

long long mod=1e9+7;

struct node1
{
    long long v;
    friend bool operator<(node1 a,node1 b)
    {
        return a.v<b.v;
    }
};

struct node2
{
    long long v;
    friend bool operator<(node2 a,node2 b)
    {
        return a.v>b.v;
    }
};

int main() {

    while(~scanf("%d",&n))
    {
        long long ans=1;
        priority_queue<node1> q1;//big down
        priority_queue<node1> q3;//big
        priority_queue<node2> q2;//small up
        while(n--)
        {
            scanf("%s",ch);
            long long tp;
            scanf("%lld",&tp);

            if(ch[1]=='D')
            {
                if((!q2.empty()) && (tp>q2.top().v))
                {
                    node2 cur;cur.v=tp;
                    q2.push(cur);
                }
                else if((!q1.empty()) && (tp<q1.top().v))
                {
                    node1 cur;cur.v=tp;
                    q1.push(cur);
                }
                else
                {
                    node1 cur;cur.v=tp;
                    q3.push(cur);
                }
            } else
            {
                if((!q2.empty()) && (tp>=q2.top().v))
                {
                    if(tp==q2.top().v)
                        q2.pop();
                    else
                        ans=0;
                }
                else if((!q1.empty()) && (tp<=q1.top().v))
                {
                    if(tp==q1.top().v)
                        q1.pop();
                    else
                        ans=0;
                }
                else
                {
                    ans=ans*2%mod;
                    while(!q3.empty())
                    {
                        node1 cur1=q3.top();q3.pop();
                        node2 cur2;cur2.v=cur1.v;
                        if(cur1.v>tp)
                            q2.push(cur2);
                        else if(cur1.v<tp)
                            q1.push(cur1);
                    }
                }
            }
        }
        printf("%lld\n",ans);
    }
    return 0;
}


#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <string>
#include <vector>
#include <queue>
using namespace std;

int n;
char ch[15];

long long mod=1e9+7;

struct node1
{
    long long v;
    friend bool operator<(node1 a,node1 b)
    {
        return a.v>b.v;
    }
};

struct node2
{
    long long v;
    friend bool operator<(node2 a,node2 b)
    {
        return a.v<b.v;
    }
};

long long powd(long long a,long long b)
{
    long long ans=1;
    while(b>0)
    {
        if(b%2==1)
            ans=ans*a%mod;
        a=a*a%mod;
        b/=2;
    }
    return ans;
}

int main() {

    while(~scanf("%d",&n))
    {
        long long ans=1;
        //long long av=powd(2,mod-2);

        priority_queue<node1> q1;//big down
        priority_queue<node1> q3;//big
        priority_queue<node2> q2;//small up
        while(n--)
        {
            scanf("%s",ch);
            long long tp;
            scanf("%lld",&tp);

            if(ch[1]=='D')
            {
                if((!q2.empty()) && (tp>q2.top().v))
                {
                    node2 cur;cur.v=tp;
                    q2.push(cur);
                }
                else if((!q1.empty()) && (tp<q1.top().v))
                {
                    node1 cur;cur.v=tp;
                    q1.push(cur);
                }
                else
                {
                    node1 cur;cur.v=tp;
                    q3.push(cur);
                    //ans=ans*2%mod;
                }
            } else
            {
                if((!q2.empty()) && (tp>=q2.top().v))
                {
                    if(tp==q2.top().v)
                        q2.pop();
                    else
                        ans=0;
                }
                else if((!q1.empty()) && (tp<=q1.top().v))
                {
                    if(tp==q1.top().v)
                        q1.pop();
                    else
                        ans=0;
                }
                else
                {
                    ans=ans*2%mod;
                    while(!q3.empty())
                    {
                        node1 cur1=q3.top();q3.pop();
                        node2 cur2;cur2.v=cur1.v;
                        //ans=ans*av%mod;
                        if(cur2.v>tp)
                            q2.push(cur2);
                        else if(cur1.v<tp)
                            q1.push(cur1);
                    }
                }
            }
        }
        if(!q3.empty())
            ans=ans*1ll*(q3.size()+1)%mod;

        printf("%lld\n",ans);
    }
    return 0;
}


#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <string>
#include <vector>
#include <queue>
using namespace std;

int n;
char ch[15];

long long mod=1e9+7;

struct node1
{
    long long v;
    friend bool operator<(node1 a,node1 b)
    {
        return a.v<b.v;
    }
};

struct node2
{
    long long v;
    friend bool operator<(node2 a,node2 b)
    {
        return a.v>b.v;
    }
};

long long powd(long long a,long long b)
{
    long long ans=1;
    while(b>0)
    {
        if(b%2==1)
            ans=ans*a%mod;
        a=a*a%mod;
        b/=2;
    }
    return ans;
}

int main() {

    while(~scanf("%d",&n))
    {
        long long ans=1;
        long long av=powd(2,mod-2);

        priority_queue<node1> q1;//big down
        priority_queue<node1> q3;//big
        priority_queue<node2> q2;//small up
        while(n--)
        {
            scanf("%s",ch);
            long long tp;
            scanf("%lld",&tp);

            if(ch[1]=='D')
            {
                if((!q2.empty()) && (tp>q2.top().v))
                {
                    node2 cur;cur.v=tp;
                    q2.push(cur);
                }
                else if((!q1.empty()) && (tp<q1.top().v))
                {
                    node1 cur;cur.v=tp;
                    q1.push(cur);
                }
                else
                {
                    node1 cur;cur.v=tp;
                    q3.push(cur);
                    ans=ans*2%mod;
                }
            } else
            {
                if((!q2.empty()) && (tp>=q2.top().v))
                {
                    if(tp==q2.top().v)
                        q2.pop();
                    else
                        ans=0;
                }
                else if((!q1.empty()) && (tp<=q1.top().v))
                {
                    if(tp==q1.top().v)
                        q1.pop();
                    else
                        ans=0;
                }
                else
                {
                    ans=ans*2%mod;
                    while(!q3.empty())
                    {
                        node1 cur1=q3.top();q3.pop();
                        node2 cur2;cur2.v=cur1.v;
                        ans=ans*av%mod;
                        if(cur1.v>tp)
                            q2.push(cur2);
                        else if(cur1.v<tp)
                            q1.push(cur1);
                    }
                }
            }
        }
        printf("%lld\n",ans);
    }
    return 0;
}


#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <string>
#include <vector>
#include <queue>
using namespace std;

int n;
char ch[15];

long long mod=1e9+7;

struct node1
{
    long long v;
    friend bool operator<(node1 a,node1 b)
    {
        return a.v<b.v;
    }
};

struct node2
{
    long long v;
    friend bool operator<(node2 a,node2 b)
    {
        return a.v>b.v;
    }
};

long long powd(long long a,long long b)
{
    long long ans=1;
    while(b>0)
    {
        if(b%2==1)
            ans=ans*a%mod;
        a=a*a%mod;
        b/=2;
    }
    return ans;
}

int main() {

    while(~scanf("%d",&n))
    {
        long long ans=1;
        long long av=powd(2,mod-2);

        priority_queue<node1> q1;//big down
        priority_queue<node1> q3;//big
        priority_queue<node2> q2;//small up
        while(n--)
        {
            scanf("%s",ch);
            long long tp;
            scanf("%lld",&tp);

            if(ch[1]=='D')
            {
                if((!q2.empty()) && (tp>q2.top().v))
                {
                    node2 cur;cur.v=tp;
                    q2.push(cur);
                }
                else if((!q1.empty()) && (tp<q1.top().v))
                {
                    node1 cur;cur.v=tp;
                    q1.push(cur);
                }
                else
                {
                    node1 cur;cur.v=tp;
                    q3.push(cur);
                    //ans=ans*2%mod;
                }
            } else
            {
                if((!q2.empty()) && (tp>=q2.top().v))
                {
                    if(tp==q2.top().v)
                        q2.pop();
                    else
                        ans=0;
                }
                else if((!q1.empty()) && (tp<=q1.top().v))
                {
                    if(tp==q1.top().v)
                        q1.pop();
                    else
                        ans=0;
                }
                else
                {
                    ans=ans*2%mod;
                    while(!q3.empty())
                    {
                        node1 cur1=q3.top();q3.pop();
                        node2 cur2;cur2.v=cur1.v;
                        //ans=ans*av%mod;
                        if(cur1.v>tp)
                            q2.push(cur2);
                        else if(cur1.v<tp)
                            q1.push(cur1);
                    }
                }
            }
        }
        if(!q3.empty())
            ans=ans*1ll*(q3.size()+1)%mod;

        printf("%lld\n",ans);
    }
    return 0;
}


#include<iostream>
#include<cstdio>
#include<cmath>
#include<queue>
#include<vector>
#include<string.h>
#include<cstring>
#include<algorithm>
#include<set>
#include<map>
#include<fstream>
#include<cstdlib>
#include<ctime>
#include<list>
#include<climits>
#include<bitset>
using namespace std;
#define fio ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define fopen freopen("input.in", "r", stdin);freopen("output.in", "w", stdout);
#define left asfdasdasdfasdfsdfasfsdfasfdas1
#define tan asfdasdasdfasdfasfdfasfsdfasfdas
typedef long long ll;
typedef unsigned int un;
const int desll[4][2]={{0,1},{0,-1},{1,0},{-1,0}};
const ll mod=1e9+7;
const int maxn=4e5+7;
const int maxm=1e6+7;
const double eps=1e-4;
int m,n;
int ar[maxn];
set<int> se;
char ch[100];
int maxx=308983067;

int main()
{
    scanf("%d",&n);
    int ans=1;
    int l=0,r=maxx;
    bool ma=true;
    int ins=0;
    for(int i=0;i<n;i++){
        int x;
        scanf("%s",ch);
        scanf("%d",&x);
        if(ch[1]=='D'){
            if(se.count(x)==0 && l<x && x<r){
                se.insert(x);
                ins++;
            }
            else if(se.count(x)==1){
                ma=0;
            }
            else{
                se.insert(x);
            }
        }
        else{
            if(se.count(x)==1 && x<=r && x>=l){
                if(x!=l&&x!=r)ans = ans*2%mod;
                set<int>::iterator iter=se.find(x);
                if(iter==se.begin())l=0;
                else{
                    iter--;
                    l=*iter;
                    iter++;
                }
                se.erase(iter++);
                if(iter==se.end())r=maxx;
                else{
                    r=*iter;
                }
            }
            else{
                ma=0;
            }
            ins=0;
        }
    }

    if(ma)printf("%d\n",ans);
    else printf("0\n");

    return 0;
}


#include<iostream>
#include<cstdio>
#include<cmath>
#include<queue>
#include<vector>
#include<string.h>
#include<cstring>
#include<algorithm>
#include<set>
#include<map>
#include<fstream>
#include<cstdlib>
#include<ctime>
#include<list>
#include<climits>
#include<bitset>
using namespace std;
#define fio ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define fopen freopen("input.in", "r", stdin);freopen("output.in", "w", stdout);
#define left asfdasdasdfasdfsdfasfsdfasfdas1
#define tan asfdasdasdfasdfasfdfasfsdfasfdas
typedef long long ll;
typedef unsigned int un;
const int desll[4][2]={{0,1},{0,-1},{1,0},{-1,0}};
const ll mod=1e9+7;
const int maxn=4e5+7;
const int maxm=1e6+7;
const double eps=1e-4;
int m,n;
int ar[maxn];
set<int> se;
char ch[100];
int maxx=308983067;

int main()
{
    scanf("%d",&n);
    int ans=1;
    int l=0,r=maxx;
    bool ma=true;
    int ins=0;
    for(int i=0;i<n;i++){
        int x;
        scanf("%s",ch);
        scanf("%d",&x);
        if(ch[1]=='D'){
            if(se.count(x)==0 && l<x && x<r){
                se.insert(x);
                ins++;
            }
            else if(se.count(x)==1){
                ma=0;
            }
            else{
                se.insert(x);
            }
        }
        else{
            if(se.count(x)==1 && x<=r && x>=l){
                if(x!=l&&x!=r)ans = ans*2%mod;
                set<int>::iterator iter=se.find(x);
                if(iter==se.begin())l=0;
                else{
                    iter--;
                    l=*iter;
                    iter++;
                }
                se.erase(iter++);
                if(iter==se.end())r=maxx;
                else{
                    r=*iter;
                }
            }
            else{
                ma=0;
            }
            ins=0;
        }
    }
    if(ins){
        ans = 1LL*ans*(ins+1)%mod;
    }
    if(ma)printf("%d\n",ans);
    else printf("0\n");

    return 0;
}


#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <string>
#include <vector>
#include <queue>
using namespace std;

int n;
char ch[15];

long long mod=1e9+7;

struct node1
{
    long long v;
    friend bool operator<(node1 a,node1 b)
    {
        return a.v<b.v;
    }
};

struct node2
{
    long long v;
    friend bool operator<(node2 a,node2 b)
    {
        return a.v>b.v;
    }
};

long long powd(long long a,long long b)
{
    long long ans=1;
    while(b>0)
    {
        if(b%2==1)
            ans=ans*a%mod;
        a=a*a%mod;
        b/=2;
    }
    return ans;
}

int main() {

    while(~scanf("%d",&n))
    {
        //cout<<n<<endl;
        long long ans=1;
        long long av=powd(2,mod-2);

        priority_queue<node1> q1;//big down
        priority_queue<node1> q3;//big
        priority_queue<node2> q2;//small up
        for(int i=0;i<n;i++)
        {
            scanf("%s",ch);
            long long tp;
            scanf("%lld",&tp);

            if(ch[1]=='D')
            {
                if((!q2.empty()) && (tp>q2.top().v))
                {
                    node2 cur;cur.v=tp;
                    q2.push(cur);
                }
                else if((!q1.empty()) && (tp<q1.top().v))
                {
                    node1 cur;cur.v=tp;
                    q1.push(cur);
                }
                else
                {
                    node1 cur;cur.v=tp;
                    q3.push(cur);
                    //ans=ans*2%mod;
                }
            } else
            {
                if((!q2.empty()) && (tp>=q2.top().v))
                {
                    if(tp==q2.top().v)
                        q2.pop(),ans=ans*av%mod;
                    else
                        ans=0;
                }
                else if((!q1.empty()) && (tp<=q1.top().v))
                {
                    if(tp==q1.top().v)
                        q1.pop(),ans=ans*av%mod;
                    else
                        ans=0;
                }

                {
                    ans=ans*2%mod;
                    //cout<<ans<<endl;
                    while(!q3.empty())
                    {
                        node1 cur1=q3.top();q3.pop();
                        node2 cur2;cur2.v=cur1.v;
                        //ans=ans*av%mod;
                        if(cur2.v>tp)
                            q2.push(cur2);
                        else if(cur1.v<tp)
                            q1.push(cur1);
                    }
                }
            }
        }
        if(!q3.empty())
            ans=ans*1ll*(q3.size()+1)%mod;

        printf("%lld\n",ans);
    }
    return 0;
}