//package codeforces.contest.c1393;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.Map;
import java.util.StringTokenizer;

/*
6
1 1 1 2 1 1
6
+ 2
+ 1
- 1
+ 2
- 1
+ 2
 */
public class B {

    static void solve() {
        int n = FS.nextInt();
        int arr[] = FS.readArray(n);
        int q = FS.nextInt();
        Map<Integer, Integer> d = new HashMap<>(10000);
        for (int i : arr) {
            Integer am = d.get(i);
            if (am == null) am = 1;
            else am++;
            d.put(i, am);
        }
        for (int i = 0; i < q; i++) {
            char c = FS.next().charAt(0);
            int am = FS.nextInt();
            if (c == '-') {
                Integer r = d.get(am);
                if (r == 1) {
                    d.remove(am);
                } else {
                    r -= 1;
                    d.put(am, r);
                }
            }
            if (c == '+') {
                Integer r = d.get(am);
                if (r == null) {
                    r = 1;
                } else {
                    r++;
                }
                d.put(am, r);
            }

            int kv = 0, pr = 0;

            for (Map.Entry<Integer, Integer> entry : d.entrySet()) {
                Integer k = entry.getKey();
                Integer v = entry.getValue();

                if (v >= 8) {
                    kv++;
                    pr+=2;
                    continue;
                }
                if (v >= 6) {
                    kv++;
                    pr++;
                    continue;
                }
                if (v >= 4) {
                    kv++;
                    continue;
                }
                if (v >= 2) {
                    pr++;
                }
            }

            if (kv >= 1 && pr >= 2 || kv >= 2) {
                FS.pt.println("YES");
            } else {
                FS.pt.println("NO");
            }
        }
    }

    public static void main(String[] args) {
//        int T = FS.nextInt();
//        for (int tt = 0; tt < T; tt++) {
            solve();
//        }
        FS.pt.close();
    }

    static class FS {
        private static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        private static StringTokenizer st = new StringTokenizer("");
        static PrintWriter pt = new PrintWriter(System.out);

        static String next() {
            while (!st.hasMoreTokens())
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            return st.nextToken();
        }

        static int nextInt() {
            return Integer.parseInt(next());
        }

        static int[] readArray(int n) {
            int[] a = new int[n];
            for (int i = 0; i < n; i++) a[i] = nextInt();
            return a;
        }

        static int[][] read2Array(int m, int n) {
            int[][] a = new int[m][n];
            for (int i = 0; i < m; i++) {
                for (int j = 0; j < n; j++) {
                    a[i][j] = nextInt();
                }
            }
            return a;
        }

        static void printArr(int[] arr) {
            for (int value : arr) {
                pt.print(value);
                pt.print(" ");
            }
            pt.println();
        }

        static void print2Arr(int[][] arr, int m, int n) {
            for (int i = 0; i < m; i++) {
                for (int j = 0; j < n; j++) {
                    pt.print(arr[i][j]);
                    pt.print(" ");
                }
                pt.println();
            }
            pt.println();
        }

        static void close() {
            pt.close();
        }

        static long nextLong() {
            return Long.parseLong(next());
        }
    }
}


//package codeforces.contest.c1393;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.Map;
import java.util.StringTokenizer;

/*
6
1 1 1 2 1 1
6
+ 2
+ 1
- 1
+ 2
- 1
+ 2
 */
public class B {

    static void solve() {
        int n = FS.nextInt();
        int arr[] = FS.readArray(n);
        int q = FS.nextInt();
        Map<Integer, Integer> d = new HashMap<>(10000);
        for (int i : arr) {
            Integer am = d.get(i);
            if (am == null) am = 1;
            else am++;
            d.put(i, am);
        }
        for (int i = 0; i < q; i++) {
            char c = FS.next().charAt(0);
            int am = FS.nextInt();
            if (c == '-') {
                Integer r = d.get(am);
                if (r == 1) {
                    d.put(am, 0);
                } else {
                    r -= 1;
                    d.put(am, r);
                }
            }
            if (c == '+') {
                Integer r = d.get(am);
                if (r == null) {
                    r = 1;
                } else {
                    r++;
                }
                d.put(am, r);
            }

            int stor = 0;
            for (Map.Entry<Integer, Integer> entry : d.entrySet()) {
                Integer k = entry.getKey();
                Integer v = entry.getValue();
                stor += v / 2;
                if (stor >= 4) break;
            }

            if (stor >= 4) {
                FS.pt.println("YES");
            } else {
                FS.pt.println("NO");
            }
        }
    }

    public static void main(String[] args) {
//        int T = FS.nextInt();
//        for (int tt = 0; tt < T; tt++) {
            solve();
//        }
        FS.pt.close();
    }

    static class FS {
        private static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        private static StringTokenizer st = new StringTokenizer("");
        static PrintWriter pt = new PrintWriter(System.out);

        static String next() {
            while (!st.hasMoreTokens())
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            return st.nextToken();
        }

        static int nextInt() {
            return Integer.parseInt(next());
        }

        static int[] readArray(int n) {
            int[] a = new int[n];
            for (int i = 0; i < n; i++) a[i] = nextInt();
            return a;
        }

        static int[][] read2Array(int m, int n) {
            int[][] a = new int[m][n];
            for (int i = 0; i < m; i++) {
                for (int j = 0; j < n; j++) {
                    a[i][j] = nextInt();
                }
            }
            return a;
        }

        static void printArr(int[] arr) {
            for (int value : arr) {
                pt.print(value);
                pt.print(" ");
            }
            pt.println();
        }

        static void print2Arr(int[][] arr, int m, int n) {
            for (int i = 0; i < m; i++) {
                for (int j = 0; j < n; j++) {
                    pt.print(arr[i][j]);
                    pt.print(" ");
                }
                pt.println();
            }
            pt.println();
        }

        static void close() {
            pt.close();
        }

        static long nextLong() {
            return Long.parseLong(next());
        }
    }
}


//package codeforces.contest.c1393;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.Map;
import java.util.StringTokenizer;

/*
6
1 1 1 2 1 1
6
+ 2
+ 1
- 1
+ 2
- 1
+ 2
 */
public class B {

    static void solve() {
        int n = FS.nextInt();
        int arr[] = FS.readArray(n);
        int q = FS.nextInt();
        Map<Integer, Integer> d = new HashMap<>(10000);
        for (int i : arr) {
            Integer am = d.get(i);
            if (am == null) am = 1;
            else am++;
            d.put(i, am);
        }
        for (int i = 0; i < q; i++) {
            char c = FS.next().charAt(0);
            int am = FS.nextInt();
            if (c == '-') {
                Integer r = d.get(am);
                if (r == 1) {
                    d.remove(am);
                } else {
                    r -= 1;
                    d.put(am, r);
                }
            }
            if (c == '+') {
                Integer r = d.get(am);
                if (r == null) {
                    r = 1;
                } else {
                    r++;
                }
                d.put(am, r);
            }

            int kv = 0, pr = 0;

            for (Map.Entry<Integer, Integer> entry : d.entrySet()) {
                Integer k = entry.getKey();
                Integer v = entry.getValue();

                if (v >= 8) {
                    kv+=2;
                    break;
                }
                if (v >= 6) {
                    kv++;
                    pr++;
                    continue;
                }
                if (v >= 4) {
                    kv++;
                    continue;
                }
                if (v >= 2) {
                    pr++;
                }
            }

            if (kv >= 1 && pr >= 2 || kv >= 2) {
                FS.pt.println("YES");
            } else {
                FS.pt.println("NO");
            }
        }
    }

    public static void main(String[] args) {
//        int T = FS.nextInt();
//        for (int tt = 0; tt < T; tt++) {
            solve();
//        }
        FS.pt.close();
    }

    static class FS {
        private static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        private static StringTokenizer st = new StringTokenizer("");
        static PrintWriter pt = new PrintWriter(System.out);

        static String next() {
            while (!st.hasMoreTokens())
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            return st.nextToken();
        }

        static int nextInt() {
            return Integer.parseInt(next());
        }

        static int[] readArray(int n) {
            int[] a = new int[n];
            for (int i = 0; i < n; i++) a[i] = nextInt();
            return a;
        }

        static int[][] read2Array(int m, int n) {
            int[][] a = new int[m][n];
            for (int i = 0; i < m; i++) {
                for (int j = 0; j < n; j++) {
                    a[i][j] = nextInt();
                }
            }
            return a;
        }

        static void printArr(int[] arr) {
            for (int value : arr) {
                pt.print(value);
                pt.print(" ");
            }
            pt.println();
        }

        static void print2Arr(int[][] arr, int m, int n) {
            for (int i = 0; i < m; i++) {
                for (int j = 0; j < n; j++) {
                    pt.print(arr[i][j]);
                    pt.print(" ");
                }
                pt.println();
            }
            pt.println();
        }

        static void close() {
            pt.close();
        }

        static long nextLong() {
            return Long.parseLong(next());
        }
    }
}


//package CodeForces;

import java.util.ArrayList;
import java.util.Comparator;
import java.util.HashMap;
import java.util.PriorityQueue;
import java.util.Scanner;

public class AppleJackAndStorages {
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner s=new Scanner(System.in);
		int n=s.nextInt();
		int arr[]=new int[n];
		HashMap<Integer,Integer> map=new HashMap<>();
		for(int i=0;i<n;i++)
		{
			arr[i]=s.nextInt();
			if(!map.containsKey(arr[i]))
			{
				map.put(arr[i],1);
			}
			else
			{
				map.put(arr[i],map.get(arr[i])+1);
			}
		}
		int sum2=0;int sum4=0;
		for(int x:map.keySet())
		{
			sum2=sum2+map.get(x)/2;
			sum4=sum4+map.get(x)/4;
		}
		int q=s.nextInt();
		while(q>0)
		{
			char ch=s.next().charAt(0);
			int x=s.nextInt();
			int temp=0;
			if(ch=='+')
			{
				if(!map.containsKey(x))
				{
					map.put(x,1);
				}
				else
				{
					temp=map.get(x);
					map.put(x,map.get(x)+1);
				}
			}
			else
			{
				temp=map.get(x);
				map.put(x,map.get(x)-1);
			}
			sum2=sum2-temp/2;sum4=sum4-temp/4;
			sum2=sum2+map.get(x)/2;sum4=sum4+map.get(x)/4;
			if(sum2>=4&&sum4>=1)
			{
				System.out.println("YES");
			}
			else
			{
				System.out.println("NO");
			}
			q--;
		}

	}

}


//package CodeForces;

import java.util.ArrayList;
import java.util.Comparator;
import java.util.HashMap;
import java.util.PriorityQueue;
import java.util.Scanner;

public class AppleJackAndStorages {

	static class node
	{
		int num;
		int freq;
		node(int a,int b)
		{
			this.num=a;
			this.freq=b;
		}
	}

	static void print(PriorityQueue<node> pq)
	{
		for(node h:pq)
		{
			System.out.print(h.num+":"+h.freq+" ");
		}
		System.out.println();
	}

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner s=new Scanner(System.in);
//		int t=s.nextInt();
//		while(t>0)
//		{
//			int n=s.nextInt();
//			if(n<3)
//			{
//				System.out.println(n);
//			}
//			else
//			{
//				System.out.println(n-1);
//			}
//			t--;
//		}
		int n=s.nextInt();
		HashMap<Integer,node> map=new HashMap<>();
		PriorityQueue<node> pq=new PriorityQueue<node>(new Comparator<node>(){
			public int compare(node a,node b)
			{
				return b.freq-a.freq;
			}
		});
		for(int i=0;i<n;i++)
		{
			int temp=s.nextInt();
			if(!map.containsKey(temp))
			{
				node newnode=new node(temp,1);
				pq.add(newnode);
				map.put(temp,newnode);
			}
			else
			{
				map.get(temp).freq++;
			}
		}
		int q=s.nextInt();
		while(q>0)
		{
			//print(pq);
			char ch=s.next().charAt(0);
			int temp=s.nextInt();
			if(ch=='+')
			{
				if(!map.containsKey(temp))
				{
					node newnode=new node(temp,1);
					pq.add(newnode);
					map.put(temp,newnode);
				}
				else
				{
					map.get(temp).freq++;
				}
			}
			else
			{
				map.get(temp).freq--;
				if(map.get(temp).freq==0)
				{
					pq.remove(map.get(temp));
					map.remove(temp);
				}
			}

			if(pq.size()==0)
			{
				System.out.println("NO");
			}
			else if(pq.size()==1)
			{

				if(pq.peek().freq>=8)
				{
					System.out.println("YES");
				}
				else
				{
					System.out.println("NO");
				}
			}
			else
			{
				if(pq.peek().freq<4)
				{
					System.out.println("NO");
				}
				else if(pq.peek().freq>=8)
				{
					System.out.println("YES");
				}
				else
				{
					node temp1=pq.remove();
					int count=(temp1.freq-4)/2;
					ArrayList<node> xx=new ArrayList<node>();
					while(pq.size()>0&&pq.peek().freq>=2)
					{
						node yy=pq.remove();
						count=count+yy.freq/2;
						xx.add(yy);
						if(count>=2)
						{
							break;
						}
					}
					pq.add(temp1);
					for(node h:xx)
					{
						pq.add(h);
					}
					if(count>=2)
					{
						System.out.println("YES");
					}
					else
					{
						System.out.println("NO");
					}
				}
			}
			q--;

		}

	}

}


//package CodeForces;

import java.util.ArrayList;
import java.util.Comparator;
import java.util.HashMap;
import java.util.PriorityQueue;
import java.util.Scanner;

public class AppleJackAndStorages {

	static class node
	{
		int num;
		int freq;
		node(int a,int b)
		{
			this.num=a;
			this.freq=b;
		}
	}

	static void print(PriorityQueue<node> pq)
	{
		for(node h:pq)
		{
			System.out.print(h.num+":"+h.freq+" ");
		}
		System.out.println();
	}

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner s=new Scanner(System.in);
		int n=s.nextInt();
		HashMap<Integer,node> map=new HashMap<>();
		PriorityQueue<node> pq=new PriorityQueue<node>(new Comparator<node>(){
			public int compare(node a,node b)
			{
				return b.freq-a.freq;
			}
		});
		for(int i=0;i<n;i++)
		{
			int temp=s.nextInt();
			if(!map.containsKey(temp))
			{
				node newnode=new node(temp,1);
				pq.add(newnode);
				map.put(temp,newnode);
			}
			else
			{
				node newnode=new node(temp,map.get(temp).freq+1);
				pq.remove(map.get(temp));
				pq.add(newnode);
				map.put(temp,newnode);
			}
		}
		//System.out.println(pq.peek().num+" "+pq.peek().freq);
		int q=s.nextInt();
		while(q>0)
		{
			//print(pq);
			char ch=s.next().charAt(0);
			int temp=s.nextInt();
			if(ch=='+')
			{
				if(!map.containsKey(temp))
				{
					node newnode=new node(temp,1);
					pq.add(newnode);
					map.put(temp,newnode);
				}
				else
				{
					node newnode=new node(temp,map.get(temp).freq+1);
					pq.remove(map.get(temp));
					pq.add(newnode);
					map.put(temp,newnode);
				}
			}
			else
			{
				node ll=map.get(temp);
			    if(ll.freq-1>0)
			    {
			    	node newnode=new node(ll.num,ll.freq-1);
				    map.put(temp,newnode);
				    pq.remove(ll);
				    pq.add(newnode);
			    }
			    else
			    {
			    	map.remove(temp);
			    }
			}

			if(pq.size()==0)
			{
				System.out.println("NO");
			}
			else if(pq.size()==1)
			{

				if(pq.peek().freq>=8)
				{
					System.out.println("YES");
				}
				else
				{
					System.out.println("NO");
				}
			}
			else
			{
				if(pq.peek().freq<4)
				{
					System.out.println("NO");
				}
				else if(pq.peek().freq>=8)
				{
					System.out.println("YES");
				}
				else
				{
					node temp1=pq.remove();
					int count=(temp1.freq-4)/2;
					ArrayList<node> xx=new ArrayList<node>();
					while(pq.size()>0&&pq.peek().freq>=2)
					{
						node yy=pq.remove();
						count=count+yy.freq/2;
						xx.add(yy);
						if(count>=2)
						{
							break;
						}
					}
					pq.add(temp1);
					for(node h:xx)
					{
						pq.add(h);
					}
					if(count>=2)
					{
						System.out.println("YES");
					}
					else
					{
						System.out.println("NO");
					}
				}
			}
			q--;

		}

	}

}


//package CodeForces;

import java.util.ArrayList;
import java.util.Comparator;
import java.util.HashMap;
import java.util.PriorityQueue;
import java.util.Scanner;

public class AppleJackAndStorages {

	static class node
	{
		int num;
		int freq;
		node(int a,int b)
		{
			this.num=a;
			this.freq=b;
		}
	}

	static void print(PriorityQueue<node> pq)
	{
		for(node h:pq)
		{
			System.out.print(h.num+":"+h.freq+" ");
		}
		System.out.println();
	}

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner s=new Scanner(System.in);
		int n=s.nextInt();
		HashMap<Integer,node> map=new HashMap<>();
		PriorityQueue<node> pq=new PriorityQueue<node>(new Comparator<node>(){
			public int compare(node a,node b)
			{
				return b.freq-a.freq;
			}
		});
		for(int i=0;i<n;i++)
		{
			int temp=s.nextInt();
			if(!map.containsKey(temp))
			{
				node newnode=new node(temp,1);
				pq.add(newnode);
				map.put(temp,newnode);
			}
			else
			{
				node newnode=new node(temp,map.get(temp).freq+1);
				pq.remove(map.get(temp));
				pq.add(newnode);
				map.put(temp,newnode);
			}
		}
		System.out.println(pq.peek().num+" "+pq.peek().freq);
		int q=s.nextInt();
		while(q>0)
		{
			//print(pq);
			char ch=s.next().charAt(0);
			int temp=s.nextInt();
			if(ch=='+')
			{
				if(!map.containsKey(temp))
				{
					node newnode=new node(temp,1);
					pq.add(newnode);
					map.put(temp,newnode);
				}
				else
				{
					node newnode=new node(temp,map.get(temp).freq+1);
					pq.remove(map.get(temp));
					pq.add(newnode);
					map.put(temp,newnode);
				}
			}
			else
			{
				node ll=map.get(temp);
			    if(ll.freq-1>0)
			    {
			    	node newnode=new node(ll.num,ll.freq-1);
				    map.put(temp,newnode);
				    pq.remove(ll);
				    pq.add(newnode);
			    }
			    else
			    {
			    	map.remove(temp);
			    }
			}

			if(pq.size()==0)
			{
				System.out.println("NO");
			}
			else if(pq.size()==1)
			{

				if(pq.peek().freq>=8)
				{
					System.out.println("YES");
				}
				else
				{
					System.out.println("NO");
				}
			}
			else
			{
				if(pq.peek().freq<4)
				{
					System.out.println("NO");
				}
				else if(pq.peek().freq>=8)
				{
					System.out.println("YES");
				}
				else
				{
					node temp1=pq.remove();
					int count=(temp1.freq-4)/2;
					ArrayList<node> xx=new ArrayList<node>();
					while(pq.size()>0&&pq.peek().freq>=2)
					{
						node yy=pq.remove();
						count=count+yy.freq/2;
						xx.add(yy);
						if(count>=2)
						{
							break;
						}
					}
					pq.add(temp1);
					for(node h:xx)
					{
						pq.add(h);
					}
					if(count>=2)
					{
						System.out.println("YES");
					}
					else
					{
						System.out.println("NO");
					}
				}
			}
			q--;

		}

	}

}


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

public class Storages {

    static int N, Q;
    static int[] planks;

    public static void main(String[] args) throws IOException
    {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());
        N = Integer.parseInt(st.nextToken());
        planks = new int[100001];
        st = new StringTokenizer(br.readLine());
        int sum2 = 0, sum4 = 0;
        for (int i = 0; i < N; i++)
        {
            int p = Integer.parseInt(st.nextToken());
            sum2 -= planks[p] / 2;
            sum4 -= planks[p] / 4;
            planks[p]++;
            sum2 += planks[p] / 2;
            sum4 += planks[p] / 4;
        }
        st = new StringTokenizer(br.readLine());
        Q = Integer.parseInt(st.nextToken());
        for (int j = 0; j < Q; j++)
        {
            st = new StringTokenizer(br.readLine());
            String plusMinus = st.nextToken();
            int change = Integer.parseInt(st.nextToken());
            sum2 -= planks[change] / 2;
            sum4 -= planks[change] / 4;
            if (plusMinus.equals("+"))
                planks[change]++;
            else
                planks[change]--;
            sum2 += planks[change] / 2;
            sum4 += planks[change] / 4;
            if (sum2 >= 4 && sum4 >= 1)
                System.out.println("YES");
            else
                System.out.println("NO");
        }
    }
}


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

public class Storages {

    static int N, Q;
    static int[] planks;

    public static void main(String[] args) throws IOException
    {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());
        N = Integer.parseInt(st.nextToken());
        planks = new int[100001];
        st = new StringTokenizer(br.readLine());
        for (int i = 0; i < N; i++)
            planks[Integer.parseInt(st.nextToken())]++;
        st = new StringTokenizer(br.readLine());
        Q = Integer.parseInt(st.nextToken());
        for (int j = 0; j < Q; j++)
        {
            st = new StringTokenizer(br.readLine());
            int change = Integer.parseInt(st.nextToken() + Integer.parseInt(st.nextToken()));
            int val = Math.abs(change);
            planks[val] += change/val;
            if (works())
                System.out.println("YES");
            else
                System.out.println("NO");
        }
    }

    public static boolean works()
    {
        long sum2 = 0;
        long sum4 = 0;
        for (int p : planks)
        {
            sum2 += p / 2;
            sum4 += p / 4;
        }
        return (sum4 >= 1) && (sum2 >= 4);
    }
}


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

public class Storages {

    static int N, Q;
    static ArrayList<Integer> planks;
    static int[] sizes;

    public static void main(String[] args) throws IOException
    {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());
        N = Integer.parseInt(st.nextToken());
        sizes = new int[100001];
        st = new StringTokenizer(br.readLine());
        planks = new ArrayList<>();
        for (int i = 0; i < N; i++)
        {
            int val = Integer.parseInt(st.nextToken());
            planks.add(val);
            sizes[val]++;
        }
        st = new StringTokenizer(br.readLine());
        Q = Integer.parseInt(st.nextToken());
        for (int q = 0; q < Q; q++)
        {
            st = new StringTokenizer(br.readLine());
            String plusOrMinus = st.nextToken();
            int val = Integer.parseInt(st.nextToken());
            if (plusOrMinus.equals("+"))
            {
                planks.add(val);
                sizes[val]++;
            }
            else
            {
                planks.remove((Object)val);
                sizes[val]--;
            }
            if (works())
                System.out.println("YES");
            else
                System.out.println("NO");
        }
    }

    public static boolean works()
    {
        boolean square = false;
        boolean rectangle = false;
        boolean pair1 = false;
        boolean pair2 = false;
        for (int s : sizes)
        {
            if (s >= 8)
                return true;
            if (s >= 4 && !square)
            {
                square = true;
                if (s >= 6)
                    pair1 = true;
            }
            else if (s >= 4 && square)
                return true;
            else if (s >= 2)
            {
                if (pair1)
                    pair2 = true;
                else
                    pair1 = true;
            }
            if (pair1 && pair2)
                rectangle = true;
            if (rectangle && square)
                return true;
        }
        return rectangle && square;
    }
}


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

public class Storages {

    static int N, Q;
    static ArrayList<Integer> planks;
    static int[] sizes;

    public static void main(String[] args) throws IOException
    {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());
        N = Integer.parseInt(st.nextToken());
        sizes = new int[100001];
        st = new StringTokenizer(br.readLine());
        planks = new ArrayList<>();
        for (int i = 0; i < N; i++)
        {
            int val = Integer.parseInt(st.nextToken());
            planks.add(val);
            sizes[val]++;
        }
        st = new StringTokenizer(br.readLine());
        Q = Integer.parseInt(st.nextToken());
        for (int q = 0; q < Q; q++)
        {
            st = new StringTokenizer(br.readLine());
            String plusOrMinus = st.nextToken();
            int val = Integer.parseInt(st.nextToken());
            if (plusOrMinus.equals("+"))
            {
                planks.add(val);
                sizes[val]++;
            }
            else
            {
                planks.remove((Object)val);
                sizes[val]--;
            }
            if (works())
                System.out.println("YES");
            else
                System.out.println("NO");
        }
    }

    public static boolean works()
    {
        boolean six = false;
        boolean two = false;
        boolean four1 = false;
        boolean four2 = false;
        for (int s : sizes)
        {
            if (s == 6)
                six = true;
            if (s == 2)
                two = true;
            if (s == 4)
            {
                if (four1)
                    four2 = true;
                else
                    four1 = true;
            }
            if (s >= 8)
                return true;
            if (six && two)
                return true;
        }
        return (six && two) || (four1 && four2);
    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

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

    static class TaskB
    {
        public void solve(int testNumber, Scanner in, PrintWriter out)
        {
            int N = in.nextInt();
            int nums[] = new int[100_000 + 5];

            Set<Integer> occ2 = new HashSet<>();
            Set<Integer> occ4 = new HashSet<>();
            Set<Integer> occ6 = new HashSet<>();
            Set<Integer> occ8 = new HashSet<>();

            for (int i = 0; i < N; i++)
            {
                int idx = in.nextInt();
                nums[idx]++;
                if (nums[idx] >= 8)
                {
                    removeAll(occ2, occ4, occ6, occ8, idx);
                    occ8.add(idx);
                } else if (nums[idx] >= 6)
                {
                    removeAll(occ2, occ4, occ6, occ8, idx);
                    occ6.add(idx);
                } else if (nums[idx] >= 4)
                {
                    removeAll(occ2, occ4, occ6, occ8, idx);
                    occ4.add(idx);
                } else if (nums[idx] >= 2)
                {
                    removeAll(occ2, occ4, occ6, occ8, idx);
                    occ2.add(idx);
                } else
                    removeAll(occ2, occ4, occ6, occ8, idx);
            }
            int Q = in.nextInt();
            in.nextLine();
            while (Q > 0)
            {
                String token = in.nextLine();
                boolean isPlus = token.charAt(0) == '+';
                int idx = Integer.parseInt(token.split(" ")[1]);
                nums[idx] += (isPlus ? 1 : -1);

                if (nums[idx] >= 8)
                {
                    removeAll(occ2, occ4, occ6, occ8, idx);
                    occ8.add(idx);
                } else if (nums[idx] >= 6)
                {
                    removeAll(occ2, occ4, occ6, occ8, idx);
                    occ6.add(idx);
                } else if (nums[idx] >= 4)
                {
                    removeAll(occ2, occ4, occ6, occ8, idx);
                    occ4.add(idx);
                } else if (nums[idx] >= 2)
                {
                    removeAll(occ2, occ4, occ6, occ8, idx);
                    occ2.add(idx);
                } else
                    removeAll(occ2, occ4, occ6, occ8, idx);

                if (occ8.size() >= 1
                            || (occ6.size() >= 2)
                            || (occ6.size() >= 1 && occ2.size() >= 1)
                            || (occ6.size() >= 1 && occ4.size() >= 1)
                            || (occ4.size() >= 2)
                            || (occ4.size() >= 1 && occ2.size() >= 2)
                )
                {
                    out.println("YES");
                } else
                {
                    out.println("NO");
                }
                Q--;
            }
        }

        private void removeAll(Set<Integer> occ2, Set<Integer> occ4, Set<Integer> occ6, Set<Integer> occ8, int idx)
        {
            occ2.remove(idx);
            occ4.remove(idx);
            occ6.remove(idx);
            occ8.remove(idx);
        }

    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

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

    static class TaskB
    {
        public void solve(int testNumber, Scanner in, PrintWriter out)
        {
            int N = in.nextInt();
            int nums[] = new int[10_000 + 5];

            Set<Integer> occ2 = new HashSet<>();
            Set<Integer> occ4 = new HashSet<>();
            Set<Integer> occ6 = new HashSet<>();
            Set<Integer> occ8 = new HashSet<>();

            for (int i = 0; i < N; i++)
            {
                int idx = in.nextInt();
                nums[idx]++;
                if (nums[idx] >= 8)
                {
                    removeAll(occ2, occ4, occ6, occ8, idx);
                    occ8.add(idx);
                } else if (nums[idx] >= 6)
                {
                    removeAll(occ2, occ4, occ6, occ8, idx);
                    occ6.add(idx);
                } else if (nums[idx] >= 4)
                {
                    removeAll(occ2, occ4, occ6, occ8, idx);
                    occ4.add(idx);
                } else if (nums[idx] >= 2)
                {
                    removeAll(occ2, occ4, occ6, occ8, idx);
                    occ2.add(idx);
                } else
                    removeAll(occ2, occ4, occ6, occ8, idx);
            }
            int Q = in.nextInt();
            in.nextLine();
            while (Q-- > 0)
            {
                String token = in.nextLine();
                boolean isPlus = token.charAt(0) == '+';
                int idx = Integer.parseInt(token.split(" ")[1]);
                nums[idx] += (isPlus ? 1 : -1);

                if (nums[idx] >= 8)
                {
                    removeAll(occ2, occ4, occ6, occ8, idx);
                    occ8.add(idx);
                } else if (nums[idx] >= 6)
                {
                    removeAll(occ2, occ4, occ6, occ8, idx);
                    occ6.add(idx);
                } else if (nums[idx] >= 4)
                {
                    removeAll(occ2, occ4, occ6, occ8, idx);
                    occ4.add(idx);
                } else if (nums[idx] >= 2)
                {
                    removeAll(occ2, occ4, occ6, occ8, idx);
                    occ2.add(idx);
                } else
                    removeAll(occ2, occ4, occ6, occ8, idx);

                if (occ8.size() >= 1
                            || (occ6.size() >= 2)
                            || (occ6.size() >= 1 && occ2.size() >= 1)
                            || (occ4.size() >= 2)
                            || (occ4.size() >= 1 && occ2.size() >= 2)
                )
                {
                    out.println("YES");
                } else
                {
                    out.println("NO");
                }

            }
        }

        private void removeAll(Set<Integer> occ2, Set<Integer> occ4, Set<Integer> occ6, Set<Integer> occ8, int idx)
        {
            occ2.remove(idx);
            occ4.remove(idx);
            occ6.remove(idx);
            occ8.remove(idx);
        }

    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

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

    static class TaskB
    {
        public void solve(int testNumber, Scanner in, PrintWriter out)
        {
            int N = in.nextInt();
            int nums[] = new int[10_000 + 5];

            Set<Integer> occ2 = new HashSet<>();
            Set<Integer> occ4 = new HashSet<>();
            Set<Integer> occ6 = new HashSet<>();
            Set<Integer> occ8 = new HashSet<>();

            for (int i = 0; i < N; i++)
            {
                int idx = in.nextInt();
                nums[idx]++;
                if (nums[idx] >= 8)
                {
                    removeAll(occ2, occ4, occ6, occ8, idx);
                    occ8.add(idx);
                } else if (nums[idx] >= 6)
                {
                    removeAll(occ2, occ4, occ6, occ8, idx);
                    occ6.add(idx);
                } else if (nums[idx] >= 4)
                {
                    removeAll(occ2, occ4, occ6, occ8, idx);
                    occ4.add(idx);
                } else if (nums[idx] >= 2)
                {
                    removeAll(occ2, occ4, occ6, occ8, idx);
                    occ2.add(idx);
                } else
                    removeAll(occ2, occ4, occ6, occ8, idx);
            }
            int Q = in.nextInt();
            while (Q-- > 0)
            {
                String token = in.next();
                boolean isPlus = token.charAt(0) == '+';
                int idx = in.nextInt();
                nums[idx] += (isPlus ? 1 : -1);

                if (nums[idx] >= 8)
                {
                    removeAll(occ2, occ4, occ6, occ8, idx);
                    occ8.add(idx);
                } else if (nums[idx] >= 6)
                {
                    removeAll(occ2, occ4, occ6, occ8, idx);
                    occ6.add(idx);
                } else if (nums[idx] >= 4)
                {
                    removeAll(occ2, occ4, occ6, occ8, idx);
                    occ4.add(idx);
                } else if (nums[idx] >= 2)
                {
                    removeAll(occ2, occ4, occ6, occ8, idx);
                    occ2.add(idx);
                } else
                    removeAll(occ2, occ4, occ6, occ8, idx);

                if (occ8.size() >= 1
                            || (occ6.size() >= 2)
                            || (occ6.size() >= 1 && occ2.size() >= 1)
                            || (occ4.size() >= 2)
                            || (occ4.size() >= 1 && occ2.size() >= 2)
                )
                {
                    out.println("YES");
                } else
                {
                    out.println("NO");
                }

            }
        }

        private void removeAll(Set<Integer> occ2, Set<Integer> occ4, Set<Integer> occ6, Set<Integer> occ8, int idx)
        {
            occ2.remove(idx);
            occ4.remove(idx);
            occ6.remove(idx);
            occ8.remove(idx);
        }

    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

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

    static class TaskB
    {
        public void solve(int testNumber, Scanner in, PrintWriter out)
        {
            int N = in.nextInt();
            int nums[] = new int[100_000 + 5];

            Set<Integer> occ2 = new HashSet<>();
            Set<Integer> occ4 = new HashSet<>();
            Set<Integer> occ6 = new HashSet<>();
            Set<Integer> occ8 = new HashSet<>();

            for (int i = 0; i < N; i++)
            {
                int idx = in.nextInt();
                nums[idx]++;
                if (nums[idx] >= 8)
                {
                    removeAll(occ2, occ4, occ6, occ8, idx);
                    occ8.add(idx);
                } else if (nums[idx] >= 6)
                {
                    removeAll(occ2, occ4, occ6, occ8, idx);
                    occ6.add(idx);
                } else if (nums[idx] >= 4)
                {
                    removeAll(occ2, occ4, occ6, occ8, idx);
                    occ4.add(idx);
                } else if (nums[idx] >= 2)
                {
                    removeAll(occ2, occ4, occ6, occ8, idx);
                    occ2.add(idx);
                } else
                    removeAll(occ2, occ4, occ6, occ8, idx);
            }
            int Q = in.nextInt();
            in.nextLine();
            while (Q > 0)
            {
                String token = in.nextLine();
                boolean isPlus = token.charAt(0) == '+';
                int idx = Integer.parseInt(token.split(" ")[1]);
                nums[idx] += (isPlus ? 1 : -1);

                if (nums[idx] >= 8)
                {
                    removeAll(occ2, occ4, occ6, occ8, idx);
                    occ8.add(idx);
                } else if (nums[idx] >= 6)
                {
                    removeAll(occ2, occ4, occ6, occ8, idx);
                    occ6.add(idx);
                } else if (nums[idx] >= 4)
                {
                    removeAll(occ2, occ4, occ6, occ8, idx);
                    occ4.add(idx);
                } else if (nums[idx] >= 2)
                {
                    removeAll(occ2, occ4, occ6, occ8, idx);
                    occ2.add(idx);
                } else
                    removeAll(occ2, occ4, occ6, occ8, idx);

                if (occ8.size() >= 1
                            || (occ6.size() >= 2)
                            || (occ6.size() >= 1 && occ2.size() >= 1)
                            || (occ4.size() >= 2)
                            || (occ4.size() >= 1 && occ2.size() >= 2)
                )
                {
                    out.println("YES");
                } else
                {
                    out.println("NO");
                }
                Q--;
            }
        }

        private void removeAll(Set<Integer> occ2, Set<Integer> occ4, Set<Integer> occ6, Set<Integer> occ8, int idx)
        {
            occ2.remove(idx);
            occ4.remove(idx);
            occ6.remove(idx);
            occ8.remove(idx);
        }

    }
}


import java.util.Collections;
import java.util.*;
import java.lang.*;
import java.math.BigInteger;
import java.io.*;
import java.io.*;
import java.util.*;

import java.util.Arrays;
public class  CodeChef
{

	public static void main (String[] args)  throws IOException
    { StringBuilder sb=new StringBuilder();

    	BufferedReader br=new BufferedReader(new InputStreamReader(System.in));

    		int n=Integer.parseInt(br.readLine());
    		String[] sr=br.readLine().split(" ");
    		int[] count=new int[100001];
    		int p=0,k=0;

    		for(int i=0;i<n;i++)
    		{int l=Integer.parseInt(sr[i])-1;
    			count[l]++;
    			if(count[l]%4==0)p++;
    			if(count[l]%2==0)k++;
    		}
    		k=k-2*p;

    		int q=Integer.parseInt(br.readLine());
    		for(int i=0;i<q;i++)
    		{
    			String[] ss=br.readLine().split(" ");
    			int num=Integer.parseInt(ss[1])-1;
    			if(ss[0].equals("+"))
    			{

    				count[num]++;
    				if((count[num]-1)%4==3) {p++;k--;}
    				else if((count[num]-1)%4==1)k++;;

    			}
    			else
    			{

    				count[num]--;
				if((count[num]+1)%4==0)
				{
					p--;k++;
				}
				else if((count[num]+1)%4==2)
				{
					k--;
				}

    			}

    			if(p>0&&k>1)
    				System.out.println("YES");
    			else if(p>1)
    				System.out.println("YES");

    			else
    				System.out.println("NO");
    		}

}

    }


import java.util.Collections;
import java.util.*;
import java.lang.*;
import java.math.BigInteger;
import java.io.*;
import java.io.*;
import java.util.*;

import java.util.Arrays;
public class  CodeChef
{

	public static void main (String[] args)  throws IOException
    { StringBuilder sb=new StringBuilder();

    	BufferedReader br=new BufferedReader(new InputStreamReader(System.in));

    		int n=Integer.parseInt(br.readLine());
    		String[] sr=br.readLine().split(" ");
    		int[] count=new int[100001];
    		int p=0,k=0;

    		for(int i=0;i<n;i++)
    		{int l=Integer.parseInt(sr[i])-1;
    			count[l]++;
    			if(count[l]%4==0)p++;
    			if(count[l]%2==0)k++;
    		}
    		k=k-2*p;

    		int q=Integer.parseInt(br.readLine());
    		for(int i=0;i<q;i++)
    		{
    			String ss=br.readLine();
    			int num=ss.charAt(2)-49;
    			if(ss.charAt(0)=='+')
    			{

    				count[num]++;
    				if((count[num]-1)%4==3) {p++;k--;}
    				else if((count[num]-1)%4==1)k++;;

    			}
    			else
    			{

    				count[num]--;
				if((count[num]+1)%4==0)
				{
					p--;k++;
				}
				if((count[num]+1)%4==2)
				{
					k--;
				}

    			}

    			if(p>0&&k>1)
    				System.out.println("YES");
    			else if(p>1)
    				System.out.println("YES");

    			else
    				System.out.println("NO");
    		}

}

    }


import java.util.Collections;
import java.util.*;
import java.lang.*;
import java.math.BigInteger;
import java.io.*;
import java.io.*;
import java.util.*;

import java.util.Arrays;
public class  CodeChef
{

	public static void main (String[] args)  throws IOException
    { StringBuilder sb=new StringBuilder();

    	BufferedReader br=new BufferedReader(new InputStreamReader(System.in));

    		int n=Integer.parseInt(br.readLine());
    		String[] sr=br.readLine().split(" ");
    		int[] count=new int[100000];
    		int p=0,k=0;
    		for(int i=0;i<n;i++)
    		{int l=Integer.parseInt(sr[i])-1;
    			count[l]++;
    			if(count[l]%4==0)p++;
    			else if(count[l]%2==0)k++;
    		}
    		int q=Integer.parseInt(br.readLine());
    		for(int i=0;i<q;i++)
    		{
    			String ss=br.readLine();
    			int num=ss.charAt(2)-49;
    			if(ss.charAt(0)=='+')
    			{

    				count[num]++;
    				if(count[num]%4==0)p++;
    				else if(count[num]%2==0)k++;

    			}
    			else
    			{count[num]--;
				if(((count[num]+1)%4==0)&&(count[num]%4!=0))p--;
				else if(((count[num]+1)%2==0)&&(count[num]%2!=0))k--;

    			}

    			if(p>0&&k>p+1)
    				System.out.println("YES");
    			else if(p>1)
    				System.out.println("YES");

    			else
    				System.out.println("NO");
    		}

}

    }


import java.util.Scanner;

public class demo_B2 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt(), i, a[] = new int[100001], c[] = new int[100001];
        for (i = 0; i < n; i++) {
            int x = in.nextInt();
            a[x]++;
            c[a[x]]++;
        }
        int q = in.nextInt();
        while (q-- > 0) {
            String s = in.next();
            int x = in.nextInt();

            if (s.equals("+")) {
                a[x]++;
                c[a[x]]++;
            } else {
                c[a[x]]--;
                a[x]--;
            }
            if(c[8]>0)
                System.out.println("YSE");
            else if((c[6] > 0 && c[2] > 1))
                System.out.println("YSE");
            else if(c[4] > 1)
                System.out.println("YSE");
            else if((c[4] > 0 && c[2] > 2))
                System.out.println("YES");

        }
        in.close();
    }
}


import java.util.Scanner;

public class demo_B2 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt(), i, a[] = new int[100001], c[] = new int[100001];
        for (i = 0; i < n; i++) {
            int x = in.nextInt();
            a[x]++;
            c[a[x]]++;
        }
        int q = in.nextInt();
        while (q-- > 0) {
            String s = in.next();
            int x = in.nextInt();

            if (s.equals("+")) {
                a[x]++;
                c[a[x]]++;
            } else {
                c[a[x]]--;
                a[x]--;
            }
            System.out.println(c[8] > 0 || (c[6] > 0 && c[2] > 1) || c[4] > 1 || (c[4] > 0 && c[2] > 2) ? "YES" : "NO");
        }
    }
}


import java.util.Arrays;
import java.util.Scanner;

public class demo_B {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        StringBuilder print = new StringBuilder();
        int t = scan.nextInt();
        int[] a = new int[t];
        Arrays.fill(a, 0);
        for (int i = 0; i < t; i++) {
            int x = scan.nextInt();
            a[x]++;
        }
        int op = scan.nextInt();
        boolean ans = false;
        for (int i = 0; i < op; i++) {
            char ch = scan.next().charAt(0);
            int x = scan.nextInt();
            if (ch == '-') {
                a[x]--;
            } else {
                a[x]++;
            }

            ans = false;

            for (int j = 0; j < t; j++) {
                if (a[j] / 4 >= 2) {
                    ans = true;
                    break;
                } else if (a[j] / 4 == 1 && a[j] % 4 >= 2) {
                    for (int k = j+1; k < t; k++) {
                        if (a[k] / 2 >= 1) {
                            ans = true;
                            break;
                        }
                    }
                } else if (a[j] / 4 == 1 && a[j] % 4 < 2) {
                    for (int k = j+1; k < t; k++) {
                        if (a[k] / 4 >= 1) {
                            ans = true;
                            break;
                        }
                    }
                }
            }
            if (ans)
                System.out.println("YES");
            else
                System.out.println("NO");
        }
    }
}


import java.util.Scanner;

public class demo_B2 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt(), i, a[] = new int[100001], c[] = new int[100001];
        for (i = 0; i < n; i++) {
            int x = in.nextInt();
            a[x]++;
            c[a[x]]++;
        }
        int q = in.nextInt();
        while (q-- > 0) {
            String s = in.next();
            int x = in.nextInt();

            if (s.equals("+")) {
                a[x]++;
                c[a[x]]++;
            } else {
                c[a[x]]--;
                a[x]--;
            }
            if(c[8]>0)
                System.out.println("YSE");
            else if((c[6] > 0 && c[2] > 1))
                System.out.println("YSE");
            else if(c[4] > 1)
                System.out.println("YSE");
            else if((c[4] > 0 && c[2] > 2))
                System.out.println("YES");
            else
                System.out.println("NO");

        }
        in.close();
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;

public class Main {
    public static void main(String[] args){
        FastReader sc = new FastReader();
        int n = sc.nextInt();
        Map<Integer, Pair> map = new HashMap<>();
        for (int i = 1; i <= n; ++i) {
            int len = sc.nextInt();
            addToMap(map, len);
        }

        PriorityQueue<Pair> pq = new PriorityQueue<>((p1, p2) -> p2.freq - p1.freq);
        for(int len : map.keySet()){
            pq.offer(map.get(len));
        }

        int q = sc.nextInt();
        for (int i = 1; i <= q; ++i) {
            String opn = sc.nextLine();
            String[] opArr = opn.split("\\s+");
            int len = Integer.parseInt(opArr[1]);
            Pair p;
            if (opArr[0].equals("+"))
                p = addToMap(map, len);
            else
                p = removeFromMap(map, len);

            pq.remove(p);
            pq.offer(p);

            //check

            Pair pp1 = null, pp2 = null, pp3 = null;
            if (!pq.isEmpty())
                pp1 = pq.poll();
            if (!pq.isEmpty())
                pp2 = pq.poll();
            if (!pq.isEmpty())
                pp3 = pq.poll();

            boolean possible = false;

            if (pp1 != null && pp1.freq >= 8)
                possible = true;
            else if (pp1 != null && pp2 != null &&
                    ((pp1.freq >= 4 && pp2.freq >= 4) || (pp1.freq >= 6 && pp2.freq >= 2)))
                possible = true;
            else if (pp1 != null && pp2 != null && pp3 != null
                    && (pp1.freq >= 4 && pp2.freq >= 2 && pp3.freq >= 2))
                possible = true;

            if (pp1 != null) {
                pq.offer(pp1);
            }
            if (pp2 != null) {
                pq.offer(pp2);
            }
            if (pp3 != null) {
                pq.offer(pp3);
            }

            if (possible)
                System.out.println("YES");
            else System.out.println("NO");

        }

    }

    private static Pair removeFromMap(Map<Integer, Pair> map, int len){
        Pair p = map.get(len);
        --p.freq;

        return p;
    }

    private static Pair addToMap(Map<Integer, Pair> map, int len){
        Pair p;
        if(!map.containsKey(len)){
            p = new Pair(len, 1);
        }
        else{
            p = map.get(len);
            ++p.freq;
        }
        map.put(len, p);

        return p;
    }

    private static class Pair {
        int len;
        int freq;

        Pair(int len, int freq) {
            this.len = len;
            this.freq = freq;
        }

        @Override
        public String toString() {
            return "Pair{" +
                    "len=" + len +
                    ", freq=" + freq +
                    '}';
        }
    }

    private static class FastReader {
        private BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;

public class Main {
    public static void main(String[] args){
        FastReader sc = new FastReader();
        int n = sc.nextInt();
        int MAX_LEN = 100001;
        //Map<Integer, Pair> map = new HashMap<>();
        Pair[] lenArr = new Pair[MAX_LEN];
        for (int i = 1; i <= n; ++i) {
            int len = sc.nextInt();
            //addToMap(map, len);
            addLen(lenArr, len);
        }

        PriorityQueue<Pair> pq = new PriorityQueue<>((p1, p2) -> p2.freq - p1.freq);
        for(int len = 1; len < MAX_LEN; ++len){
            if(lenArr[len] != null)
                pq.offer(lenArr[len]);
        }

        StringBuffer sb = new StringBuffer();
        int q = sc.nextInt();
        for (int i = 1; i <= q; ++i) {
            String opn = sc.nextLine();
            String[] opArr = opn.split("\\s+");
            int len = Integer.parseInt(opArr[1]);
            Pair p;
            if (opArr[0].equals("+")){
                // p = addToMap(map, len);
                p = addLen(lenArr, len);
            }
            else{
                // p = removeFromMap(map, len);
                p = removeLen(lenArr, len);
            }

            pq.remove(p);
            pq.offer(p);

            Pair pp1 = null, pp2 = null, pp3 = null;
            if (!pq.isEmpty())
                pp1 = pq.poll();
            if (!pq.isEmpty())
                pp2 = pq.poll();
            if (!pq.isEmpty())
                pp3 = pq.poll();

            //System.out.println(pp1 +", " + pp2 +", " + pp3);
            boolean possible = false;

            if (pp1 != null && pp1.freq >= 8)
                possible = true;
            else if (pp1 != null && pp2 != null &&
                    ((pp1.freq >= 4 && pp2.freq >= 4) || (pp1.freq >= 6 && pp2.freq >= 2)))
                possible = true;
            else if (pp1 != null && pp2 != null && pp3 != null
                    && (pp1.freq >= 4 && pp2.freq >= 2 && pp3.freq >= 2))
                possible = true;

            if (pp1 != null) {
                pq.offer(pp1);
            }
            if (pp2 != null) {
                pq.offer(pp2);
            }
            if (pp3 != null) {
                pq.offer(pp3);
            }

            if (possible)
                sb.append("YES\n");
            else sb.append("NO\n");
        }

        System.out.println(sb.toString());
    }

    private static Pair addLen(Pair[] lenArr, int len) {
        Pair p = null;
        if(lenArr[len] == null){
            p = new Pair(len, 0);
            lenArr[len] = p;
        }
        else
            p = lenArr[len];
        ++p.freq;

        return p;
    }

    private static Pair removeLen(Pair[] lenArr, int len) {
        Pair p = lenArr[len];
        --p.freq;

        return p;
    }

    private static Pair removeFromMap(Map<Integer, Pair> map, int len){
        Pair p = map.get(len);
        --p.freq;

        return p;
    }

    private static Pair addToMap(Map<Integer, Pair> map, int len){
        Pair p;
        if(!map.containsKey(len)){
            p = new Pair(len, 1);
        }
        else{
            p = map.get(len);
            ++p.freq;
        }
        map.put(len, p);

        return p;
    }

    private static class Pair {
        int len;
        int freq;

        Pair(int len, int freq) {
            this.len = len;
            this.freq = freq;
        }

        @Override
        public String toString() {
            return "Pair{" +
                    "len=" + len +
                    ", freq=" + freq +
                    '}';
        }
    }

    private static class FastReader {
        private BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;

public class Main {
    public static void main(String[] args){
        FastReader sc = new FastReader();
        int n = sc.nextInt();
        Map<Integer, Pair> map = new HashMap<>();
        for (int i = 1; i <= n; ++i) {
            int len = sc.nextInt();
            addToMap(map, len);
        }

        PriorityQueue<Pair> pq = new PriorityQueue<>((p1, p2) -> p2.freq - p1.freq);
        for(int len : map.keySet()){
            pq.offer(map.get(len));
        }

        int q = sc.nextInt();
        for (int i = 1; i <= q; ++i) {
            String opn = sc.nextLine();
            String[] opArr = opn.split("\\s+");
            int len = Integer.parseInt(opArr[1]);
            Pair p;
            if (opArr[0].equals("+"))
                p = addToMap(map, len);
            else
                p = removeFromMap(map, len);

            pq.remove(p);
            pq.offer(p);

            //check

            Pair pp1 = null, pp2 = null, pp3 = null;
            if (!pq.isEmpty())
                pp1 = pq.poll();
            if (!pq.isEmpty())
                pp2 = pq.poll();
            if (!pq.isEmpty())
                pp3 = pq.poll();

            boolean possible = false;

            if (pp1 != null && pp1.freq >= 8)
                possible = true;
            else if (pp1 != null && pp2 != null && (pp1.freq >= 4 && pp2.freq >= 4)
                    || (pp1.freq >= 6 && pp2.freq >= 2))
                possible = true;
            else if (pp1 != null && pp2 != null && pp3 != null && pp1.freq >= 4
                    && pp2.freq >= 2 && pp3.freq >= 2)
                possible = true;

            if (pp1 != null) {
                pq.offer(pp1);
            }
            if (pp2 != null) {
                pq.offer(pp2);
            }
            if (pp3 != null) {
                pq.offer(pp3);
            }

            if (possible)
                System.out.println("YES");
            else System.out.println("NO");

        }

    }

    private static Pair removeFromMap(Map<Integer, Pair> map, int len){
        Pair p = map.get(len);
        --p.freq;

        return p;
    }

    private static Pair addToMap(Map<Integer, Pair> map, int len){
        Pair p;
        if(!map.containsKey(len)){
            p = new Pair(len, 1);
        }
        else{
            p = map.get(len);
            ++p.freq;
        }
        map.put(len, p);

        return p;
    }

    private static class Pair {
        int len;
        int freq;

        Pair(int len, int freq) {
            this.len = len;
            this.freq = freq;
        }
    }

    private static class FastReader {
        private BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;

public class Main {
    public static void main(String[] args){
        FastReader sc = new FastReader();
        int n = sc.nextInt();
        int MAX_LEN = 100001;
        //Map<Integer, Pair> map = new HashMap<>();
        Pair[] lenArr = new Pair[MAX_LEN];
        for (int i = 1; i <= n; ++i) {
            int len = sc.nextInt();
            //addToMap(map, len);
            addLen(lenArr, len);
        }

        PriorityQueue<Pair> pq = new PriorityQueue<>((p1, p2) -> p2.freq - p1.freq);
        for(int len = 1; len < MAX_LEN; ++len){
            if(lenArr[len] != null)
                pq.offer(lenArr[len]);
        }

        StringBuffer sb = new StringBuffer();
        int q = sc.nextInt();
        for (int i = 1; i <= q; ++i) {
            String opn = sc.nextLine();
            String[] opArr = opn.split("\\s+");
            int len = Integer.parseInt(opArr[1]);
            Pair p;
            if (opArr[0].equals("+")){
                // p = addToMap(map, len);
                p = addLen(lenArr, len);
            }
            else{
                // p = removeFromMap(map, len);
                p = removeLen(lenArr, len);
            }

            pq.remove(p);
            pq.offer(p);

            Pair pp1 = null, pp2 = null, pp3 = null;
            if (!pq.isEmpty())
                pp1 = pq.poll();
            if (!pq.isEmpty())
                pp2 = pq.poll();
            if (!pq.isEmpty())
                pp3 = pq.poll();

            boolean possible = false;

            if (pp1 != null && pp1.freq >= 8)
                possible = true;
            else if (pp1 != null && pp2 != null &&
                    ((pp1.freq >= 4 && pp2.freq >= 4) || (pp1.freq >= 6 && pp2.freq >= 2)))
                possible = true;
            else if (pp1 != null && pp2 != null && pp3 != null
                    && (pp1.freq >= 4 && pp2.freq >= 2 && pp3.freq >= 2))
                possible = true;

            if (pp1 != null) {
                pq.offer(pp1);
            }
            if (pp2 != null) {
                pq.offer(pp2);
            }
            if (pp3 != null) {
                pq.offer(pp3);
            }

            if (possible)
                sb.append("YES\n");
            else sb.append("NO\n");
        }

        System.out.println(sb.toString());
    }

    private static Pair addLen(Pair[] lenArr, int len) {
        Pair p = null;
        if(lenArr[len] == null){
            p = new Pair(len, 1);
            lenArr[len] = p;
        }
        else
            p = lenArr[len];
        ++p.freq;

        return p;
    }

    private static Pair removeLen(Pair[] lenArr, int len) {
        Pair p = lenArr[len];
        --p.freq;

        return p;
    }

    private static Pair removeFromMap(Map<Integer, Pair> map, int len){
        Pair p = map.get(len);
        --p.freq;

        return p;
    }

    private static Pair addToMap(Map<Integer, Pair> map, int len){
        Pair p;
        if(!map.containsKey(len)){
            p = new Pair(len, 1);
        }
        else{
            p = map.get(len);
            ++p.freq;
        }
        map.put(len, p);

        return p;
    }

    private static class Pair {
        int len;
        int freq;

        Pair(int len, int freq) {
            this.len = len;
            this.freq = freq;
        }

        @Override
        public String toString() {
            return "Pair{" +
                    "len=" + len +
                    ", freq=" + freq +
                    '}';
        }
    }

    private static class FastReader {
        private BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;

public class Main {
    public static void main(String[] args){
        FastReader sc = new FastReader();
        int n = sc.nextInt();
        int MAX_LEN = 100001;

        int countMoreThanEquals4s = 0;
        int countMoreThanEquals2s = 0;

        int[] arrLen = new int[MAX_LEN];
        for (int i = 1; i <= n; ++i) {
            int len = sc.nextInt();
            ++arrLen[len];
            if(arrLen[len] == 4) {
                ++countMoreThanEquals4s;
                --countMoreThanEquals2s;
            }
            else if(arrLen[len] == 2)
                ++countMoreThanEquals2s;
            else if(arrLen[len] > 4){
                int extra = arrLen[len] - 4;
                if(extra % 2 == 0)
                    ++countMoreThanEquals2s;
            }
        }

       /* System.out.println("ar[1] = " + arrLen[1] +", ar[2] = " + arrLen[2] +" :: "
                +  countMoreThanEquals4s +", " + countMoreThanEquals2s);*/
        StringBuffer sb = new StringBuffer();
        int q = sc.nextInt();
        for (int i = 1; i <= q; ++i) {
            String opn = sc.nextLine();
            String[] opArr = opn.split("\\s+");
            int len = Integer.parseInt(opArr[1]);
            if (opArr[0].equals("+")){
                ++arrLen[len];
                if(arrLen[len] == 4) {
                    ++countMoreThanEquals4s;
                    --countMoreThanEquals2s;
                }
                else if(arrLen[len] == 2)
                    ++countMoreThanEquals2s;
                else if(arrLen[len] > 4){
                    int extra = arrLen[len] - 4;
                    if(extra % 2 == 0)
                        ++countMoreThanEquals2s;
                }
            }
            else{
                --arrLen[len];
                if(arrLen[len] % 2 == 1){
                    if(arrLen[len] == 1)
                        --countMoreThanEquals2s;
                    else if(arrLen[len] == 3){
                        --countMoreThanEquals4s;
                        ++countMoreThanEquals2s;
                    }else{
                        --countMoreThanEquals2s;
                    }
                }
            }
           /* System.out.println("ar[1] = " + arrLen[1] +", ar[2] = " + arrLen[2] +" :: "
                    +  countMoreThanEquals4s +", " + countMoreThanEquals2s);*/
            boolean possible = false;
            if(countMoreThanEquals4s >= 1 && (countMoreThanEquals4s >= 2 || countMoreThanEquals2s >= 2))
                possible = true;
            if (possible)
                sb.append("YES\n");
            else sb.append("NO\n");
        }

        System.out.println(sb.toString());
    }

    private static class FastReader {
        private BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;

public class Main {
    public static void main(String[] args){
        FastReader sc = new FastReader();
        int n = sc.nextInt();
        Map<Integer, Pair> map = new HashMap<>();
        for (int i = 1; i <= n; ++i) {
            int len = sc.nextInt();
            addToMap(map, len);
        }

        PriorityQueue<Pair> pq = new PriorityQueue<>((p1, p2) -> p2.freq - p1.freq);
        for(int len : map.keySet()){
            pq.offer(map.get(len));
        }

        StringBuffer sb = new StringBuffer();
        int q = sc.nextInt();
        for (int i = 1; i <= q; ++i) {
            String opn = sc.nextLine();
            String[] opArr = opn.split("\\s+");
            int len = Integer.parseInt(opArr[1]);
            Pair p;
            if (opArr[0].equals("+"))
                p = addToMap(map, len);
            else
                p = removeFromMap(map, len);

            pq.remove(p);
            pq.offer(p);

            Pair pp1 = null, pp2 = null, pp3 = null;
            if (!pq.isEmpty())
                pp1 = pq.poll();
            if (!pq.isEmpty())
                pp2 = pq.poll();
            if (!pq.isEmpty())
                pp3 = pq.poll();

            boolean possible = false;

            if (pp1 != null && pp1.freq >= 8)
                possible = true;
            else if (pp1 != null && pp2 != null &&
                    ((pp1.freq >= 4 && pp2.freq >= 4) || (pp1.freq >= 6 && pp2.freq >= 2)))
                possible = true;
            else if (pp1 != null && pp2 != null && pp3 != null
                    && (pp1.freq >= 4 && pp2.freq >= 2 && pp3.freq >= 2))
                possible = true;

            if (pp1 != null) {
                pq.offer(pp1);
            }
            if (pp2 != null) {
                pq.offer(pp2);
            }
            if (pp3 != null) {
                pq.offer(pp3);
            }

            if (possible)
                sb.append("YES\n");
            else sb.append("NO\n");
        }

        System.out.println(sb.toString());
    }

    private static Pair removeFromMap(Map<Integer, Pair> map, int len){
        Pair p = map.get(len);
        --p.freq;

        return p;
    }

    private static Pair addToMap(Map<Integer, Pair> map, int len){
        Pair p;
        if(!map.containsKey(len)){
            p = new Pair(len, 1);
        }
        else{
            p = map.get(len);
            ++p.freq;
        }
        map.put(len, p);

        return p;
    }

    private static class Pair {
        int len;
        int freq;

        Pair(int len, int freq) {
            this.len = len;
            this.freq = freq;
        }

        @Override
        public String toString() {
            return "Pair{" +
                    "len=" + len +
                    ", freq=" + freq +
                    '}';
        }
    }

    private static class FastReader {
        private BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;

public class B1393 {
    static class Pair{
        int f;
        int s;
        Pair(int f, int s){
            this.f = f;
            this.s = s;
        }
    }
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        int a[] = new int[n];
        String in[] = br.readLine().trim().split(" ");

        Map<Integer, Integer> M = new HashMap<>();

        Set<Integer>two = new HashSet<>();
        Set<Integer>four = new HashSet<>();
        Set<Integer>six = new HashSet<>();
        Set<Integer>eight = new HashSet<>();

        for (int i=0;i<n;++i){
            a[i] = Integer.parseInt(in[i]);
            if (M.containsKey(a[i])){
                M.put(a[i], M.get(a[i]) + 1);
            } else {
                M.put(a[i], 1);
            }
            if (M.get(a[i]) == 2){
                two.add(a[i]);
            }
            if (M.get(a[i]) == 4){
                two.remove(a[i]);
                four.add(a[i]);
            }
            if (M.get(a[i]) == 6){
                four.remove(a[i]);
                six.add(a[i]);
            }
            if (M.get(a[i]) == 8){
                six.remove(a[i]);
                eight.add(a[i]);
            }
        }

        int q = Integer.parseInt(br.readLine());

        while (q-- > 0){
            in = br.readLine().trim().split(" ");
            int x = Integer.parseInt(in[1]);
            if (in[0].charAt(0) == '+'){
                if (M.containsKey(x)){
                    M.put(x, M.get(x) + 1);
                } else {
                    M.put(x, 1);
                }

                if (M.get(x) == 2){
                    two.add(x);
                }
                if (M.get(x) == 4){
                    two.remove(x);
                    four.add(x);
                }
                if (M.get(x) == 6){
                    four.remove(x);
                    six.add(x);
                }
                if (M.get(x) == 8){
                    six.remove(x);
                    eight.add(x);
                }

            } else {
                if (M.containsKey(x)){
                    M.put(x, M.get(x) - 1);
                }
                if (M.get(x) == 2){
                    if (four.contains(x)){
                        four.remove(x);
                    }
                    two.add(x);
                }
                if (M.get(x) == 4){
                    if (six.contains(x)){
                        six.remove(x);
                    }
                    four.add(x);
                }
                if (M.get(x) == 6){
                    if (eight.contains(x)){
                        eight.remove(x);
                    }
                    six.add(x);
                }
                if (M.get(x) == 8){
                    eight.add(x);
                }
            }

            boolean condition = false;
            if (eight.size() > 0){
                condition = true;
            } else if (six.size() > 1){
                condition = true;
            } else if (six.size()>0 && four.size()>0){
                condition = true;
            } else if (six.size()>0 && two.size()>0){
                condition = true;
            } else if (four.size()>1){
                condition = true;
            } else if (four.size()>0 && two.size()>1){
                condition = true;
            }

            if (condition) {
                System.out.println("YES");
            } else {
                System.out.println("NO");
            }
        }
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

public class B1393 {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        int n = Integer.parseInt(br.readLine());
        int a[] = new int[n];
        String in[] = br.readLine().trim().split(" ");
        Map<Integer, Integer> M = new HashMap<>();
        Set<Integer> Square = new HashSet<>();
        Set<Integer> Rectangle = new HashSet<>();
        for (int i=0;i<n;++i) {
            a[i] = Integer.parseInt(in[i]);
            if (M.containsKey(a[i])){
                M.put(a[i], M.get(a[i])+1);
            } else {
                M.put(a[i], 1);
            }
            if (M.get(a[i]) == 4){
                Rectangle.remove(a[i]);
                Square.add(a[i]);
            }
            if (M.get(a[i]) == 2){
                Rectangle.add(a[i]);
            }
        }
        int q = Integer.parseInt(br.readLine());
        while (q-- > 0){
            in = br.readLine().trim().split(" ");
            int x = Integer.parseInt(in[1]);
            if (in[0].charAt(0) == '+'){
                if (M.containsKey(x)){
                    M.put(x, M.get(x)+1);
                } else {
                    M.put(x, 1);
                }
            } else {
                if (M.containsKey(x)){
                    M.put(x, M.get(x)-1);
                }
            }
            if (M.get(x) == 4){
                if (Rectangle.contains(x)){
                    Rectangle.remove(x);
                }
                Square.add(x);
            }
            if ((M.get(x) == 2)){
                if (Square.contains(x)){
                    Square.remove(x);
                }
                Rectangle.add(x);
            }
            if ((M.get(x) == 3)){
                if (Square.contains(x)){
                    Square.remove(x);
                }
                Rectangle.add(x);
            }
            if ((M.get(x) == 5)){
                if (Rectangle.contains(x)){
                    Rectangle.remove(x);
                }
            }
            if ((M.get(x) >= 6)){
                Rectangle.add(x);
            }
            boolean condition1 = Square.size() > 1;
            boolean condition2 = (Square. size() > 0) && (Rectangle.size() > 1);
            if (condition1) {
                System.out.println("YES");
            } else {
                if (condition2) {
                    System.out.println("YES");
                } else {
                    System.out.println("NO");
                }
            }
        }
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;

public class B1393 {
    static class Pair{
        int f;
        int s;
        Pair(int f, int s){
            this.f = f;
            this.s = s;
        }
    }
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        int a[] = new int[n];
        String in[] = br.readLine().trim().split(" ");

        Map<Integer, Integer> M = new HashMap<>();

        Set<Integer>two = new HashSet<>();
        Set<Integer>four = new HashSet<>();
        Set<Integer>six = new HashSet<>();
        Set<Integer>eight = new HashSet<>();

        for (int i=0;i<n;++i){
            a[i] = Integer.parseInt(in[i]);
            if (M.containsKey(a[i])){
                M.put(a[i], M.get(a[i]) + 1);
            } else {
                M.put(a[i], 1);
            }
            if (M.get(a[i]) == 2){
                two.add(a[i]);
            }
            if (M.get(a[i]) == 4){
                two.remove(a[i]);
                four.add(a[i]);
            }
            if (M.get(a[i]) == 6){
                four.remove(a[i]);
                six.add(a[i]);
            }
            if (M.get(a[i]) == 8){
                six.remove(a[i]);
                eight.add(a[i]);
            }
        }

        int q = Integer.parseInt(br.readLine());

        while (q-- > 0){
            in = br.readLine().trim().split(" ");
            int x = Integer.parseInt(in[1]);
            if (in[0].charAt(0) == '+'){
                if (M.containsKey(x)){
                    M.put(x, M.get(x) + 1);
                } else {
                    M.put(x, 1);
                }

                if (M.get(x) == 2){
                    two.add(x);
                }
                if (M.get(x) == 4){
                    two.remove(x);
                    four.add(x);
                }
                if (M.get(x) == 6){
                    four.remove(x);
                    six.add(x);
                }
                if (M.get(x) == 8){
                    six.remove(x);
                    eight.add(x);
                }

            } else {
                if (M.containsKey(x)){
                    M.put(x, M.get(x) - 1);
                }
                if(M.get(x) < 2){
                    if(two.contains(x)){
                        two.remove(x);
                    }
                }
                if (M.get(x) >= 2 && M.get(x) < 4){
                    if (four.contains(x)){
                        four.remove(x);
                    }
                    two.add(x);
                }
                if (M.get(x) >= 4 && M.get(x) < 6){
                    if (six.contains(x)){
                        six.remove(x);
                    }
                    four.add(x);
                }
                if (M.get(x) >= 6 && M.get(x) < 8){
                    if (eight.contains(x)){
                        eight.remove(x);
                    }
                    six.add(x);
                }
                if (M.get(x) == 8){
                    eight.add(x);
                }
            }

            boolean condition = false;
            if (eight.size() > 0){
                condition = true;
            } else if (six.size() > 1){
                condition = true;
            } else if (six.size()>0 && four.size()>0){
                condition = true;
            } else if (six.size()>0 && two.size()>0){
                condition = true;
            } else if (four.size()>1){
                condition = true;
            } else if (four.size()>0 && two.size()>1){
                condition = true;
            }

            if (condition) {
                System.out.println("YES");
            } else {
                System.out.println("NO");
            }
        }
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;

public class B1393 {
    static class Pair{
        int f;
        int s;
        Pair(int f, int s){
            this.f = f;
            this.s = s;
        }
    }
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        int a[] = new int[n];
        String in[] = br.readLine().trim().split(" ");
        Map<Integer, Integer> M = new HashMap<>();
        Map<Integer, Pair>Mp = new HashMap<>();
        PriorityQueue<Pair>P = new PriorityQueue<>(new Comparator<Pair>() {
            @Override
            public int compare(Pair o1, Pair o2) {
                return o2.s - o1.s;
            }
        });
        for (int i=0;i<n;++i) {
            a[i] = Integer.parseInt(in[i]);
            if (M.containsKey(a[i])){
                M.put(a[i], M.get(a[i])+1);
            } else {
                M.put(a[i], 1);
            }
        }
        for (Map.Entry<Integer,Integer> entry : M.entrySet()){
            Pair p = new Pair(entry.getKey(), entry.getValue());
            Mp.put(entry.getKey(), p);
            P.add(p);
        }
        int q = Integer.parseInt(br.readLine());
        while (q-- > 0){
            in = br.readLine().trim().split(" ");
            int x = Integer.parseInt(in[1]);
            if (in[0].charAt(0) == '+'){
                if (M.containsKey(x)){
                    P.remove(Mp.get(x));
                    M.put(x, M.get(x)+1);
                } else {
                    M.put(x, 1);
                }
                Pair p = new Pair(x, M.get(x));
                Mp.put(x, p);
                P.add(p);
            } else {
                if (M.containsKey(x)){
                    P.remove(Mp.get(x));
                    M.put(x, M.get(x)-1);
                    if (M.get(x)>0) {
                        Pair p = new Pair(x, M.get(x));
                        Mp.put(x, p);
                        P.add(p);
                    }
                }
            }
            Pair top1 = null, top2 = null, top3 = null;
            boolean yes = false;
            if (!P.isEmpty()) {
                top1 = P.peek();
                P.poll();
                if (top1.s >= 8){
                    yes = true;
                }
                if (!yes && !P.isEmpty()){
                    top2 = P.peek();
                    P.poll();
                    if (top1.s>=6 && top2.s>=2) {
                        yes = true;
                    }
                    if (top1.s>=4 && top2.s>=4) {
                        yes = true;
                    }
                    if (!yes && !P.isEmpty()){
                        top3 = P.peek();
                        P.poll();
                        if (top1.s>=4 && top2.s>=2 && top3.s>=2) {
                            yes = true;
                        }
                    }
                }
            }
            if (top1!=null) P.add(top1);
            if (top2!=null) P.add(top2);
            if (top3!=null) P.add(top3);
            if (yes) {
                System.out.println("YES");
            } else {
                System.out.println("NO");
            }
        }
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;

public class B1393 {
    static class Pair{
        int f;
        int s;
        Pair(int f, int s){
            this.f = f;
            this.s = s;
        }
    }
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        int n = Integer.parseInt(br.readLine());
        int a[] = new int[n];
        String in[] = br.readLine().trim().split(" ");
        Map<Integer, Integer> M = new HashMap<>();
        Map<Integer, Pair>Mp = new HashMap<>();
        Set<Integer> Square = new HashSet<>();
        Set<Integer> Rectangle = new HashSet<>();
        PriorityQueue<Pair>P = new PriorityQueue<>(new Comparator<Pair>() {
            @Override
            public int compare(Pair o1, Pair o2) {
                return o2.s - o1.s;
            }
        });

        for (int i=0;i<n;++i) {
            a[i] = Integer.parseInt(in[i]);
            if (M.containsKey(a[i])){
                M.put(a[i], M.get(a[i])+1);
            } else {
                M.put(a[i], 1);
            }
//            if (M.get(a[i]) == 4){
//                Rectangle.remove(a[i]);
//                Square.add(a[i]);
//            }
//            if (M.get(a[i]) == 2){
//                Rectangle.add(a[i]);
//            }
        }

        for (Map.Entry<Integer,Integer> entry : M.entrySet()){
            Pair p = new Pair(entry.getKey(), entry.getValue());
            Mp.put(entry.getKey(), p);
            P.add(p);
        }

        int q = Integer.parseInt(br.readLine());
        while (q-- > 0){
            in = br.readLine().trim().split(" ");
            int x = Integer.parseInt(in[1]);
            if (in[0].charAt(0) == '+'){
                if (M.containsKey(x)){
                    P.remove(Mp.get(x));
                    M.put(x, M.get(x)+1);
                } else {
                    M.put(x, 1);
                }
                Pair p = new Pair(x, M.get(x));
                Mp.put(x, p);
                P.add(p);
            } else {
                if (M.containsKey(x)){
                    P.remove(Mp.get(x));
                    M.put(x, M.get(x)-1);
                    if (M.get(x)>0) {
                        Pair p = new Pair(x, M.get(x));
                        Mp.put(x, p);
                        P.add(p);
                    }
                }
            }

//            if (M.get(x) == 4){
//                if (Rectangle.contains(x)){
//                    Rectangle.remove(x);
//                }
//                Square.add(x);
//            }
//            if ((M.get(x) == 2)){
//                if (Square.contains(x)){
//                    Square.remove(x);
//                }
//                Rectangle.add(x);
//            }
//            if ((M.get(x) == 3)){
//                if (Square.contains(x)){
//                    Square.remove(x);
//                }
//                Rectangle.add(x);
//            }
//            if ((M.get(x) == 5)){
//                if (Rectangle.contains(x)){
//                    Rectangle.remove(x);
//                }
//            }
//            if ((M.get(x) >= 6)){
//                Rectangle.add(x);
//            }

            Pair top1 = null, top2 = null, top3 = null;
            boolean yes = false;
            if (!P.isEmpty()) {
                top1 = P.peek();
                P.poll();
                if (top1.s >= 8){
                    yes = true;
                }
                if (!P.isEmpty()){
                    top2 = P.peek();
                    P.poll();
                    if (top1.s>=6 && top2.s>=2) {
                        yes = true;
                    }
                    if (top1.s>=4 && top2.s>=4) {
                        yes = true;
                    }
                    if (!P.isEmpty()){
                        top3 = P.peek();
                        P.poll();
                        if (top1.s>=4 && top2.s>=2 && top3.s>=2) {
                            yes = true;
                        }
                    }
                }
            }
            if (top1!=null) P.add(top1);
            if (top2!=null) P.add(top2);
            if (top3!=null) P.add(top3);
            if (yes) {
                System.out.println("YES");
            } else {
                System.out.println("NO");
            }
        }
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;

public class B1393 {
    static class Pair{
        int f;
        int s;
        Pair(int f, int s){
            this.f = f;
            this.s = s;
        }
    }
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        int a[] = new int[n];
        String in[] = br.readLine().trim().split(" ");

        Map<Integer, Integer> M = new HashMap<>();

        Set<Integer>two = new HashSet<>();
        Set<Integer>four = new HashSet<>();
        Set<Integer>six = new HashSet<>();
        Set<Integer>eight = new HashSet<>();

        for (int i=0;i<n;++i){
            a[i] = Integer.parseInt(in[i]);
            if (M.containsKey(a[i])){
                M.put(a[i], M.get(a[i]) + 1);
            } else {
                M.put(a[i], 1);
            }
            if (M.get(a[i]) == 2){
                two.add(a[i]);
            }
            if (M.get(a[i]) == 4){
                two.remove(a[i]);
                four.add(a[i]);
            }
            if (M.get(a[i]) == 6){
                four.remove(a[i]);
                six.add(a[i]);
            }
            if (M.get(a[i]) == 8){
                six.remove(a[i]);
                eight.add(a[i]);
            }
        }

        int q = Integer.parseInt(br.readLine());

        while (q-- > 0){
            in = br.readLine().trim().split(" ");
            int x = Integer.parseInt(in[1]);
            if (in[0].charAt(0) == '+'){
                if (M.containsKey(x)){
                    M.put(x, M.get(x) + 1);
                } else {
                    M.put(x, 1);
                }

                if (M.get(x) == 2){
                    two.add(x);
                }
                if (M.get(x) == 4){
                    two.remove(x);
                    four.add(x);
                }
                if (M.get(x) == 6){
                    four.remove(x);
                    six.add(x);
                }
                if (M.get(x) == 8){
                    six.remove(x);
                    eight.add(x);
                }

            } else {
                if (M.containsKey(x)){
                    M.put(x, M.get(x) - 1);
                }
                if (M.get(x) >= 2 && M.get(x) < 4){
                    if (four.contains(x)){
                        four.remove(x);
                    }
                    two.add(x);
                }
                if (M.get(x) >= 4 && M.get(x) < 6){
                    if (six.contains(x)){
                        six.remove(x);
                    }
                    four.add(x);
                }
                if (M.get(x) >= 6 && M.get(x) < 8){
                    if (eight.contains(x)){
                        eight.remove(x);
                    }
                    six.add(x);
                }
                if (M.get(x) == 8){
                    eight.add(x);
                }
            }

            boolean condition = false;
            if (eight.size() > 0){
                condition = true;
            } else if (six.size() > 1){
                condition = true;
            } else if (six.size()>0 && four.size()>0){
                condition = true;
            } else if (six.size()>0 && two.size()>0){
                condition = true;
            } else if (four.size()>1){
                condition = true;
            } else if (four.size()>0 && two.size()>1){
                condition = true;
            }

            if (condition) {
                System.out.println("YES");
            } else {
                System.out.println("NO");
            }
        }
    }
}