import java.util.*;
import java.lang.*;
import java.io.*;
public class Codechef
{
	public static void main (String[] args) throws java.lang.Exception
	{
	    Scanner sc=new Scanner(System.in);
	   // BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
	   // int t=1;
	    //t=sc.nextInt();
	  //  int t=Integer.parseInt(br.readLine());
	  //  while(--t>=0){
	        int n=sc.nextInt();
	         //     int n=Integer.parseInt(br.readLine());
	          //     int k=sc.nextInt();
	          //    String s=br.readLine();
	         //     StringTokenizer st=new StringTokenizer(br.readLine());
	         //      int n=Integer.parseInt(st.nextToken());
	         int arr[]=new int[n];
	         int feq[]=new int[100001];
	         int q[]=new int[8];
	       // for(int i=0;i<n;i++)a[i]=sc.nextInt();
	       for(int i=0;i<n;i++){
          arr[i]=sc.nextInt();
          feq[arr[i]]++;
      }
      for(int i=1;i<100001;i++){
          if(feq[i]==1)
          q[0]++;
          else if(feq[i]==2)
          q[1]++;
          else if(feq[i]==3)
          q[2]++;
          else if(feq[i]==4)
          q[3]++;
          else if(feq[i]==5)
          q[4]++;
          else if(feq[i]==6)
          q[5]++;
          else if(feq[i]==7)
          q[6]++;
          else if(feq[i]>=8)
          q[7]++;
      }
     // System.out.println(q[3]);
      int t=sc.nextInt();
      while(--t>=0){
          char ch;
          int x;
          ch=sc.next().charAt(0);
          x=sc.nextInt();
          if(ch=='-'){
              feq[x]--;
              if(feq[x]==0)
              q[0]--;
              else if(feq[x]==1){
              q[0]++;q[1]--;
              }
              else if(feq[x]==2){
                  q[1]++;q[2]--;
              }
              else if(feq[x]==3){
                  q[2]++;q[3]--;
              }
              else if(feq[x]==4){
                  q[3]++;q[4]--;
              }
              else if(feq[x]==5){
                  q[4]++;q[5]--;
              }
              else if(feq[x]==6){
                  q[5]++;q[6]--;
              }
              else if(feq[x]==7){
                  q[6]++;q[7]--;
              }
          }
          else{
              feq[x]++;
              if(feq[x]==1){
              q[0]++;
              }
              else if(feq[x]==2){
                  q[1]++;q[0]--;
              }
              else if(feq[x]==3){
                  q[2]++;q[1]--;
              }
              else if(feq[x]==4){
                  q[3]++;q[2]--;
              }
              else if(feq[x]==5){
                  q[4]++;q[3]--;
              }
              else if(feq[x]==6){
                  q[5]++;
                  q[4]--;
              }
              else if(feq[x]==7){
                  q[6]++;q[5]--;
              }
              else if(feq[x]==8){
                  q[7]++;q[6]--;
              }

          }
          if((q[3]+q[4]+q[5]+q[6]+q[7])>=2)
         System.out.println("YES");
          else if((q[3]+q[4]+q[5]+q[6]+q[7])<1)
          System.out.println("NO");
          else{
              if((q[1]+q[2])>=2)
               System.out.println("YES");
              else if((q[1]+q[2])==1&&(q[5]+q[6]+q[7])>=1)
              System.out.println("YES");
              else if(q[7]>=1)
              System.out.println("YES");
              else
              System.out.println("NO");
          }

      }

	      //  for(int i=0;i<n;i++)
	      //  System.out.print(arr[i]+" ");

//	    }

	}
}


import java.util.*;
import java.lang.*;
import java.io.*;
public class Codechef
{
	public static void main (String[] args) throws java.lang.Exception
	{
	    Scanner sc=new Scanner(System.in);
	   // BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
	   // int t=1;
	    //t=sc.nextInt();
	  //  int t=Integer.parseInt(br.readLine());
	  //  while(--t>=0){
	        int n=sc.nextInt();
	         //     int n=Integer.parseInt(br.readLine());
	          //     int k=sc.nextInt();
	          //    String s=br.readLine();
	         //     StringTokenizer st=new StringTokenizer(br.readLine());
	         //      int n=Integer.parseInt(st.nextToken());
	         int arr[]=new int[n];
	         int feq[]=new int[100001];
	         int q[]=new int[4];
	       // for(int i=0;i<n;i++)a[i]=sc.nextInt();
	       for(int i=0;i<n;i++){
          arr[i]=sc.nextInt();
          feq[arr[i]]++;
      }
      HashMap<Integer,Integer> map=new HashMap<>();
      for(int i=1;i<100001;i++){
          if(feq[i]==1)
          q[0]++;
          else if(feq[i]==2)
          q[1]++;
          else if(feq[i]==3)
          q[2]++;
          else if(feq[i]>=4)
          q[3]++;
          if(feq[i]>=6){
              if(!map.containsKey(i))
              map.put(i,1);
              else
              map.put(i,map.get(i)+1);
          }
      }
     // System.out.println(q[3]);
      int t=sc.nextInt();
      while(--t>=0){
          char ch;
          int x;
          ch=sc.next().charAt(0);
          x=sc.nextInt();
          if(ch=='-'){
              feq[x]--;
              if(feq[x]==0)
              q[0]--;
              else if(feq[x]==1){
              q[0]++;q[1]--;
              }
              else if(feq[x]==2){
                  q[1]++;q[2]--;
              }
              else if(feq[x]==3){
                  q[2]++;q[3]--;
              }
              if(feq[x]==5)
              map.remove(x);
          }
          else{
              feq[x]++;
              if(feq[x]==1){
              q[0]++;
              }
              else if(feq[x]==2){
                  q[1]++;q[0]--;
              }
              else if(feq[x]==3){
                  q[2]++;q[1]--;
              }
              else if(feq[x]==4){
                  q[3]++;q[2]--;
              }
              if(feq[x]==6){
                  if(!map.containsKey(x))
                  map.put(x,1);
                  else
                  map.put(x,map.get(x)+1);
              }
          }

          if(q[3]>=2)
         System.out.println("YES");
          else if(q[3]<1)
          System.out.println("NO");
          else{
              if((q[1]+q[2])>=2)
               System.out.println("YES");
             else if((q[1]>=1||q[2]>=1)&&map.size()>=1)
             System.out.println("YES");
              else
             System.out.println("NO");

          }

      }

	      //  for(int i=0;i<n;i++)
	      //  System.out.print(arr[i]+" ");

//	    }

	}
}


import java.util.*;
import java.lang.*;
import java.io.*;
public class Codechef
{
	public static void main (String[] args) throws java.lang.Exception
	{
	    Scanner sc=new Scanner(System.in);
	   // BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
	   // int t=1;
	    //t=sc.nextInt();
	  //  int t=Integer.parseInt(br.readLine());
	  //  while(--t>=0){
	        int n=sc.nextInt();
	         //     int n=Integer.parseInt(br.readLine());
	          //     int k=sc.nextInt();
	          //    String s=br.readLine();
	         //     StringTokenizer st=new StringTokenizer(br.readLine());
	         //      int n=Integer.parseInt(st.nextToken());
	         int arr[]=new int[n];
	         int feq[]=new int[100001];
	         int q[]=new int[4];
	       // for(int i=0;i<n;i++)a[i]=sc.nextInt();
	       for(int i=0;i<n;i++){
          arr[i]=sc.nextInt();
          feq[arr[i]]++;
      }
      HashMap<Integer,Integer> map=new HashMap<>();
      for(int i=1;i<100001;i++){
          if(feq[i]==1)
          q[0]++;
          else if(feq[i]==2)
          q[1]++;
          else if(feq[i]==3)
          q[2]++;
          else if(feq[i]>=4)
          q[3]++;
          if(feq[i]>=6){
              if(!map.containsKey(i))
              map.put(i,1);
          }
      }
     // System.out.println(q[3]);
      int t=sc.nextInt();
      while(--t>=0){
          char ch;
          int x;
          ch=sc.next().charAt(0);
          x=sc.nextInt();
          if(ch=='-'){
              feq[x]--;
              if(feq[x]==0)
              q[0]--;
              else if(feq[x]==1){
              q[0]++;q[1]--;
              }
              else if(feq[x]==2){
                  q[1]++;q[2]--;
              }
              else if(feq[x]==3){
                  q[2]++;q[3]--;
              }
              if(feq[x]==5)
              map.remove(x);
          }
          else{
              feq[x]++;
              if(feq[x]==1){
              q[0]++;
              }
              else if(feq[x]==2){
                  q[1]++;q[0]--;
              }
              else if(feq[x]==3){
                  q[2]++;q[1]--;
              }
              else if(feq[x]==4){
                  q[3]++;q[2]--;
              }
              if(feq[x]==6){
                  if(!map.containsKey(x))
                  map.put(x,1);
              }
          }

          if(q[3]>=2)
         System.out.println("YES");
          else if(q[3]<1)
          System.out.println("NO");
          else{
              if((q[1]+q[2])>=2)
               System.out.println("YES");
             else if((q[1]>=1||q[2]>=1)&&map.size()>=1)
             System.out.println("YES");
              else
             System.out.println("NO");

          }

      }

	      //  for(int i=0;i<n;i++)
	      //  System.out.print(arr[i]+" ");

//	    }

	}
}


import java.util.*;
import java.lang.*;
import java.io.*;
public class Codechef
{
	public static void main (String[] args) throws java.lang.Exception
	{
	    Scanner sc=new Scanner(System.in);
	   // BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
	   // int t=1;
	    //t=sc.nextInt();
	  //  int t=Integer.parseInt(br.readLine());
	  //  while(--t>=0){
	        int n=sc.nextInt();
	         //     int n=Integer.parseInt(br.readLine());
	          //     int k=sc.nextInt();
	          //    String s=br.readLine();
	         //     StringTokenizer st=new StringTokenizer(br.readLine());
	         //      int n=Integer.parseInt(st.nextToken());
	         int arr[]=new int[n];
	         int feq[]=new int[100001];
	         int q[]=new int[4];
	       // for(int i=0;i<n;i++)a[i]=sc.nextInt();
	       for(int i=0;i<n;i++){
          arr[i]=sc.nextInt();
          feq[arr[i]]++;
      }
      HashMap<Integer,Integer> map=new HashMap<>();
      for(int i=1;i<=n;i++){
          if(feq[i]==1)
          q[0]++;
          else if(feq[i]==2)
          q[1]++;
          else if(feq[i]==3)
          q[2]++;
          else if(feq[i]>=4)
          q[3]++;
          if(feq[i]>=6){
              if(!map.containsKey(i))
              map.put(i,1);
          }
      }
     // System.out.println(q[3]);
      int t=sc.nextInt();
      while(--t>=0){
          char ch;
          int x;
          ch=sc.next().charAt(0);
          x=sc.nextInt();
          if(ch=='-'){
              feq[x]--;
              if(feq[x]==0)
              q[0]--;
              else if(feq[x]==1){
              q[0]++;q[1]--;
              }
              else if(feq[x]==2){
                  q[1]++;q[2]--;
              }
              else if(feq[x]==3){
                  q[2]++;q[3]--;
              }
              if(feq[x]==5)
              map.remove(x);
          }
          else{
              feq[x]++;
              if(feq[x]==1){
              q[0]++;
              }
              else if(feq[x]==2){
                  q[1]++;q[0]--;
              }
              else if(feq[x]==3){
                  q[2]++;q[1]--;
              }
              else if(feq[x]==4){
                  q[3]++;q[2]--;
              }
              if(feq[x]==6){
                  if(!map.containsKey(x))
                  map.put(x,1);
              }
          }

          if(q[3]>=2)
         System.out.println("YES");
          else if(q[3]<1)
          System.out.println("NO");
          else{
              if((q[1]+q[2])>=2)
               System.out.println("YES");
             else if((q[1]>=1||q[2]>=1)&&map.size()>=1)
             System.out.println("YES");
              else
             System.out.println("NO");

          }

      }

	      //  for(int i=0;i<n;i++)
	      //  System.out.print(arr[i]+" ");

//	    }

	}
}


import java.util.*;

import java.io.*;

public class B {

    static int mod = (int) (1e9+7);
    static InputReader in;
    static PrintWriter out;

    static void solve()
    {

        in = new InputReader(System.in);
        out = new PrintWriter(System.out);

        int t = 1;
        int maxn = 1000001;

        while(t-- > 0) {
        	int n = in.nextInt();
        	int[] count = new int[maxn];

        	int[] arr = new int[10];

        	for(int i = 1; i <= n; i++) {
        		int x = in.nextInt();
        		count[x]++;
        		if(count[x] == 8) {
        			arr[8]++;
        			arr[6]--;
        		}
        		else if(count[x] == 6) {
        			arr[6]++;
        			arr[4]--;
        		}
        		else if(count[x] == 4) {
        			arr[4]++;
        			arr[2]--;
        		}
        		else if(count[x] == 2) {
        			arr[2]++;
        		}
        	}
        	int q = in.nextInt();

        	while(q-- > 0) {
        		char c = in.readString().charAt(0);
        		int x = in.nextInt();

        		if(c == '+') {
        			count[x]++;
        			if(count[x] == 8) {
            			arr[8]++;
            			arr[6]--;
            		}
            		else if(count[x] == 6) {
            			arr[6]++;
            			arr[4]--;
            		}
            		else if(count[x] == 4) {
            			arr[4]++;
            			arr[2]--;
            		}
            		else if(count[x] == 2) {
            			arr[2]++;
            		}
        		}
        		else if(c == '-') {
        			if(count[x] == 8) {
            			arr[8]--;
            			arr[6]++;
            		}
            		else if(count[x] == 6) {
            			arr[6]--;
            			arr[4]++;
            		}
            		else if(count[x] == 4) {
            			arr[4]--;
            			arr[2]++;
            		}
            		else if(count[x] == 2) {
            			arr[2]--;
            		}

        			count[x]--;
        		}

        		boolean ok = (arr[8] >= 1);
        		ok |= (arr[6] >= 1 && arr[2] >= 1);
        		ok |= (arr[4] >= 2);
        		ok |= (arr[4] >= 1 && arr[2] >= 2);

//        		debug(arr);
        		out.println(ok? "YES": "NO");
        	}

        }

        out.close();

    }

    public static void main(String[] args) {
        new Thread(null ,new Runnable(){
            public void run()
            {
                try{
                    solve();
                } catch(Exception e){
                    e.printStackTrace();
                }
            }
        },"1",1<<26).start();
    }

    static int[][] graph(int from[], int to[], int n)
    {
        int g[][] = new int[n][];
        int cnt[] = new int[n];
        for (int i = 0; i < from.length; i++) {
            cnt[from[i]]++;
            cnt[to[i]]++;
        }
        for (int i = 0; i < n; i++) {
            g[i] = new int[cnt[i]];
        }
        Arrays.fill(cnt, 0);
        for (int i = 0; i < from.length; i++) {
            g[from[i]][cnt[from[i]]++] = to[i];
            g[to[i]][cnt[to[i]]++] = from[i];
        }
        return g;
    }

    static class Pair implements Comparable<Pair>{

        int x,y,i;

		Pair (int x,int y,int i){
			this.x=x;
			this.y=y;
			this.i=i;
		}

		Pair (int x,int y){
			this.x=x;
			this.y=y;
		}

		public int compareTo(Pair o) {
			if(this.x!=o.x)
	                    return Integer.compare(this.x,o.x);
			else
	                    return Integer.compare(this.y,o.y);
			//return 0;
		}

        public boolean equals(Object o) {
            if (o instanceof Pair) {
                Pair p = (Pair)o;
                return p.x == x && p.y == y && p.i==i;
            }
            return false;
        }
        public int hashCode() {
            return new Integer(x).hashCode() * 31 + new Integer(y).hashCode()+new Integer(i).hashCode()*37;
        }

    }

    static String rev(String s) {
        StringBuilder sb = new StringBuilder(s);
        sb.reverse();
        return sb.toString();
    }

    static long gcd(long x, long y) {
        if (y == 0) {
            return x;
        } else {
            return gcd(y, x % y);
        }
    }

    static int gcd(int x, int y) {
        if (y == 0) {
            return x;
        } else {
            return gcd(y, x % y);
        }
    }

    static int abs(int a, int b) {
        return (int) Math.abs(a - b);
    }

    static long abs(long a, long b) {
        return (long) Math.abs(a - b);
    }

    static int max(int a, int b) {
        if (a > b) {
            return a;
        } else {
            return b;
        }
    }

    static int min(int a, int b) {
        if (a > b) {
            return b;
        } else {
            return a;
        }
    }

    static long max(long a, long b) {
        if (a > b) {
            return a;
        } else {
            return b;
        }
    }

    static long min(long a, long b) {
        if (a > b) {
            return b;
        } else {
            return a;
        }
    }

    static long pow(long n, long p, long m) {
        long result = 1;
        if (p == 0) {
            return 1;
        }
        while (p != 0) {
            if (p % 2 == 1) {
                result *= n;
            }
            if (result >= m) {
                result %= m;
            }
            p >>= 1;
            n *= n;
            if (n >= m) {
                n %= m;
            }
        }
        return result;
    }

    static long pow(long n, long p) {
        long result = 1;
        if (p == 0) {
            return 1;
        }
        if (p == 1) {
            return n;
        }
        while (p != 0) {
            if (p % 2 == 1) {
                result *= n;
            }
            p >>= 1;
            n *= n;
        }
        return result;
    }

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

    static class InputReader
    {

        private final InputStream stream;
        private final byte[] buf = new byte[8192];
        private int curChar, snumChars;
        private SpaceCharFilter filter;

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

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

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

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

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

        public long[] nextLongArray(int n)
        {
                long a[] = new long[n];
                for (int i = 0; i < n; i++)
                {
                        a[i] = nextLong();
                }
                return a;
        }

        public String readString()
        {
                int c = snext();
                while (isSpaceChar(c))
                {
                        c = snext();
                }
                StringBuilder res = new StringBuilder();
                do
                {
                        res.appendCodePoint(c);
                        c = snext();
                } while (!isSpaceChar(c));
                return res.toString();
        }

        public String nextLine()
        {
                int c = snext();
                while (isSpaceChar(c))
                        c = snext();
                StringBuilder res = new StringBuilder();
                do
                {
                        res.appendCodePoint(c);
                        c = snext();
                } while (!isEndOfLine(c));
                return res.toString();
        }

        public boolean isSpaceChar(int c)
        {
                if (filter != null)
                        return filter.isSpaceChar(c);
                return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

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

        public interface SpaceCharFilter
        {
                public boolean isSpaceChar(int ch);
        }

    }
}


import java.util.*;

import java.io.*;

public class B {

    static int mod = (int) (1e9+7);
    static InputReader in;
    static PrintWriter out;

    static void solve()
    {

        in = new InputReader(System.in);
        out = new PrintWriter(System.out);

        int t = 1;
        int maxn = 100001;

        while(t-- > 0) {
        	int n = in.nextInt();
        	int[] count = new int[maxn];

        	int[] arr = new int[10];

        	for(int i = 1; i <= n; i++) {
        		int x = in.nextInt();
        		count[x]++;
        	}

        	for(int i = 1; i < maxn; i++) {
        		if(count[i] >= 8) {
        			arr[8]++;
        		}
        		else if(count[i] >= 6) {
        			arr[6]++;
        		}
        		else if(count[i] >= 4) {
        			arr[4]++;
        		}
        		else if(count[i] >= 2) {
        			arr[2]++;
        		}
        	}

        	int q = in.nextInt();

        	while(q-- > 0) {
        		char c = in.readString().charAt(0);
        		int x = in.nextInt();

        		if(c == '+') {
        			count[x]++;
        			if(count[x] == 8) {
            			arr[8]++;
            			arr[6]--;
            		}
            		else if(count[x] == 6) {
            			arr[6]++;
            			arr[4]--;
            		}
            		else if(count[x] == 4) {
            			arr[4]++;
            			arr[2]--;
            		}
            		else if(count[x] == 2) {
            			arr[2]++;
            		}
        		}
        		else if(c == '-') {
        			if(count[x] == 8) {
            			arr[8]--;
            			arr[6]++;
            		}
            		else if(count[x] == 6) {
            			arr[6]--;
            			arr[4]++;
            		}
            		else if(count[x] == 4) {
            			arr[4]--;
            			arr[2]++;
            		}
            		else if(count[x] == 2) {
            			arr[2]--;
            		}

        			count[x]--;
        		}

        		boolean ok = arr[8] > 0;
        		ok |= arr[6] > 0 && arr[2] > 0;
        		ok |= arr[4] > 1;
        		ok |= arr[4] > 0 && arr[2] > 1;

//        		debug(arr);
        		out.println(ok? "YES": "NO");
        	}

        }

        out.close();

    }

    public static void main(String[] args) {
        new Thread(null ,new Runnable(){
            public void run()
            {
                try{
                    solve();
                } catch(Exception e){
                    e.printStackTrace();
                }
            }
        },"1",1<<26).start();
    }

    static int[][] graph(int from[], int to[], int n)
    {
        int g[][] = new int[n][];
        int cnt[] = new int[n];
        for (int i = 0; i < from.length; i++) {
            cnt[from[i]]++;
            cnt[to[i]]++;
        }
        for (int i = 0; i < n; i++) {
            g[i] = new int[cnt[i]];
        }
        Arrays.fill(cnt, 0);
        for (int i = 0; i < from.length; i++) {
            g[from[i]][cnt[from[i]]++] = to[i];
            g[to[i]][cnt[to[i]]++] = from[i];
        }
        return g;
    }

    static class Pair implements Comparable<Pair>{

        int x,y,i;

		Pair (int x,int y,int i){
			this.x=x;
			this.y=y;
			this.i=i;
		}

		Pair (int x,int y){
			this.x=x;
			this.y=y;
		}

		public int compareTo(Pair o) {
			if(this.x!=o.x)
	                    return Integer.compare(this.x,o.x);
			else
	                    return Integer.compare(this.y,o.y);
			//return 0;
		}

        public boolean equals(Object o) {
            if (o instanceof Pair) {
                Pair p = (Pair)o;
                return p.x == x && p.y == y && p.i==i;
            }
            return false;
        }
        public int hashCode() {
            return new Integer(x).hashCode() * 31 + new Integer(y).hashCode()+new Integer(i).hashCode()*37;
        }

    }

    static String rev(String s) {
        StringBuilder sb = new StringBuilder(s);
        sb.reverse();
        return sb.toString();
    }

    static long gcd(long x, long y) {
        if (y == 0) {
            return x;
        } else {
            return gcd(y, x % y);
        }
    }

    static int gcd(int x, int y) {
        if (y == 0) {
            return x;
        } else {
            return gcd(y, x % y);
        }
    }

    static int abs(int a, int b) {
        return (int) Math.abs(a - b);
    }

    static long abs(long a, long b) {
        return (long) Math.abs(a - b);
    }

    static int max(int a, int b) {
        if (a > b) {
            return a;
        } else {
            return b;
        }
    }

    static int min(int a, int b) {
        if (a > b) {
            return b;
        } else {
            return a;
        }
    }

    static long max(long a, long b) {
        if (a > b) {
            return a;
        } else {
            return b;
        }
    }

    static long min(long a, long b) {
        if (a > b) {
            return b;
        } else {
            return a;
        }
    }

    static long pow(long n, long p, long m) {
        long result = 1;
        if (p == 0) {
            return 1;
        }
        while (p != 0) {
            if (p % 2 == 1) {
                result *= n;
            }
            if (result >= m) {
                result %= m;
            }
            p >>= 1;
            n *= n;
            if (n >= m) {
                n %= m;
            }
        }
        return result;
    }

    static long pow(long n, long p) {
        long result = 1;
        if (p == 0) {
            return 1;
        }
        if (p == 1) {
            return n;
        }
        while (p != 0) {
            if (p % 2 == 1) {
                result *= n;
            }
            p >>= 1;
            n *= n;
        }
        return result;
    }

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

    static class InputReader
    {

        private final InputStream stream;
        private final byte[] buf = new byte[8192];
        private int curChar, snumChars;
        private SpaceCharFilter filter;

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

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

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

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

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

        public long[] nextLongArray(int n)
        {
                long a[] = new long[n];
                for (int i = 0; i < n; i++)
                {
                        a[i] = nextLong();
                }
                return a;
        }

        public String readString()
        {
                int c = snext();
                while (isSpaceChar(c))
                {
                        c = snext();
                }
                StringBuilder res = new StringBuilder();
                do
                {
                        res.appendCodePoint(c);
                        c = snext();
                } while (!isSpaceChar(c));
                return res.toString();
        }

        public String nextLine()
        {
                int c = snext();
                while (isSpaceChar(c))
                        c = snext();
                StringBuilder res = new StringBuilder();
                do
                {
                        res.appendCodePoint(c);
                        c = snext();
                } while (!isEndOfLine(c));
                return res.toString();
        }

        public boolean isSpaceChar(int c)
        {
                if (filter != null)
                        return filter.isSpaceChar(c);
                return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

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

        public interface SpaceCharFilter
        {
                public boolean isSpaceChar(int ch);
        }

    }
}


import java.util.*;

import java.io.*;

public class B {

    static int mod = (int) (1e9+7);
    static InputReader in;
    static PrintWriter out;

    static void solve()
    {

        in = new InputReader(System.in);
        out = new PrintWriter(System.out);

        int t = 1;
        int maxn = 1000001;

        while(t-- > 0) {
        	int n = in.nextInt();
        	int[] count = new int[maxn];

        	int[] arr = new int[n + 1];

        	for(int i = 1; i <= n; i++) {
        		int x = in.nextInt();
        		count[x]++;
        		arr[count[x]]++;
        	}
        	int q = in.nextInt();

        	while(q-- > 0) {
        		char c = in.readString().charAt(0);
        		int x = in.nextInt();

        		if(c == '+') {
        			count[x]++;
        			arr[count[x]]++;
        		}
        		else if(c == '-') {
        			arr[count[x]]--;
        			count[x]--;
        		}

        		boolean ok = (arr[8] >= 1);
        		ok |= (arr[6] >= 1 && arr[2] >= 2);
        		ok |= (arr[4] >= 2);
        		ok |= (arr[4] >= 1 && arr[2] >= 3);

//        		debug(arr);
        		out.println(ok? "YES": "NO");
        	}

        }

        out.close();

    }

    public static void main(String[] args) {
        new Thread(null ,new Runnable(){
            public void run()
            {
                try{
                    solve();
                } catch(Exception e){
                    e.printStackTrace();
                }
            }
        },"1",1<<26).start();
    }

    static int[][] graph(int from[], int to[], int n)
    {
        int g[][] = new int[n][];
        int cnt[] = new int[n];
        for (int i = 0; i < from.length; i++) {
            cnt[from[i]]++;
            cnt[to[i]]++;
        }
        for (int i = 0; i < n; i++) {
            g[i] = new int[cnt[i]];
        }
        Arrays.fill(cnt, 0);
        for (int i = 0; i < from.length; i++) {
            g[from[i]][cnt[from[i]]++] = to[i];
            g[to[i]][cnt[to[i]]++] = from[i];
        }
        return g;
    }

    static class Pair implements Comparable<Pair>{

        int x,y,i;

		Pair (int x,int y,int i){
			this.x=x;
			this.y=y;
			this.i=i;
		}

		Pair (int x,int y){
			this.x=x;
			this.y=y;
		}

		public int compareTo(Pair o) {
			if(this.x!=o.x)
	                    return Integer.compare(this.x,o.x);
			else
	                    return Integer.compare(this.y,o.y);
			//return 0;
		}

        public boolean equals(Object o) {
            if (o instanceof Pair) {
                Pair p = (Pair)o;
                return p.x == x && p.y == y && p.i==i;
            }
            return false;
        }
        public int hashCode() {
            return new Integer(x).hashCode() * 31 + new Integer(y).hashCode()+new Integer(i).hashCode()*37;
        }

    }

    static String rev(String s) {
        StringBuilder sb = new StringBuilder(s);
        sb.reverse();
        return sb.toString();
    }

    static long gcd(long x, long y) {
        if (y == 0) {
            return x;
        } else {
            return gcd(y, x % y);
        }
    }

    static int gcd(int x, int y) {
        if (y == 0) {
            return x;
        } else {
            return gcd(y, x % y);
        }
    }

    static int abs(int a, int b) {
        return (int) Math.abs(a - b);
    }

    static long abs(long a, long b) {
        return (long) Math.abs(a - b);
    }

    static int max(int a, int b) {
        if (a > b) {
            return a;
        } else {
            return b;
        }
    }

    static int min(int a, int b) {
        if (a > b) {
            return b;
        } else {
            return a;
        }
    }

    static long max(long a, long b) {
        if (a > b) {
            return a;
        } else {
            return b;
        }
    }

    static long min(long a, long b) {
        if (a > b) {
            return b;
        } else {
            return a;
        }
    }

    static long pow(long n, long p, long m) {
        long result = 1;
        if (p == 0) {
            return 1;
        }
        while (p != 0) {
            if (p % 2 == 1) {
                result *= n;
            }
            if (result >= m) {
                result %= m;
            }
            p >>= 1;
            n *= n;
            if (n >= m) {
                n %= m;
            }
        }
        return result;
    }

    static long pow(long n, long p) {
        long result = 1;
        if (p == 0) {
            return 1;
        }
        if (p == 1) {
            return n;
        }
        while (p != 0) {
            if (p % 2 == 1) {
                result *= n;
            }
            p >>= 1;
            n *= n;
        }
        return result;
    }

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

    static class InputReader
    {

        private final InputStream stream;
        private final byte[] buf = new byte[8192];
        private int curChar, snumChars;
        private SpaceCharFilter filter;

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

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

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

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

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

        public long[] nextLongArray(int n)
        {
                long a[] = new long[n];
                for (int i = 0; i < n; i++)
                {
                        a[i] = nextLong();
                }
                return a;
        }

        public String readString()
        {
                int c = snext();
                while (isSpaceChar(c))
                {
                        c = snext();
                }
                StringBuilder res = new StringBuilder();
                do
                {
                        res.appendCodePoint(c);
                        c = snext();
                } while (!isSpaceChar(c));
                return res.toString();
        }

        public String nextLine()
        {
                int c = snext();
                while (isSpaceChar(c))
                        c = snext();
                StringBuilder res = new StringBuilder();
                do
                {
                        res.appendCodePoint(c);
                        c = snext();
                } while (!isEndOfLine(c));
                return res.toString();
        }

        public boolean isSpaceChar(int c)
        {
                if (filter != null)
                        return filter.isSpaceChar(c);
                return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

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

        public interface SpaceCharFilter
        {
                public boolean isSpaceChar(int ch);
        }

    }
}


import java.util.*;

import java.io.*;

public class B {

    static int mod = (int) (1e9+7);
    static InputReader in;
    static PrintWriter out;

    static void solve()
    {

        in = new InputReader(System.in);
        out = new PrintWriter(System.out);

        int t = 1;
        int maxn = 1000001;

        while(t-- > 0) {
        	int n = in.nextInt();
        	int[] count = new int[maxn];

        	int[] arr = new int[maxn];

        	for(int i = 1; i <= n; i++) {
        		int x = in.nextInt();
        		count[x]++;
        		arr[count[x]]++;
        	}
        	int q = in.nextInt();

        	while(q-- > 0) {
        		char c = in.readString().charAt(0);
        		int x = in.nextInt();

        		if(c == '+') {
        			count[x]++;
        			arr[count[x]]++;
        		}
        		else if(c == '-') {
        			arr[count[x]]--;
        			count[x]--;
        		}

        		boolean ok = (arr[8] >= 1);
        		ok |= (arr[6] >= 1 && arr[2] >= 2);
        		ok |= (arr[4] >= 2);
        		ok |= (arr[4] >= 1 && arr[2] >= 3);

//        		debug(arr);
        		out.println(ok? "YES": "NO");
        	}

        }

        out.close();

    }

    public static void main(String[] args) {
        new Thread(null ,new Runnable(){
            public void run()
            {
                try{
                    solve();
                } catch(Exception e){
                    e.printStackTrace();
                }
            }
        },"1",1<<26).start();
    }

    static int[][] graph(int from[], int to[], int n)
    {
        int g[][] = new int[n][];
        int cnt[] = new int[n];
        for (int i = 0; i < from.length; i++) {
            cnt[from[i]]++;
            cnt[to[i]]++;
        }
        for (int i = 0; i < n; i++) {
            g[i] = new int[cnt[i]];
        }
        Arrays.fill(cnt, 0);
        for (int i = 0; i < from.length; i++) {
            g[from[i]][cnt[from[i]]++] = to[i];
            g[to[i]][cnt[to[i]]++] = from[i];
        }
        return g;
    }

    static class Pair implements Comparable<Pair>{

        int x,y,i;

		Pair (int x,int y,int i){
			this.x=x;
			this.y=y;
			this.i=i;
		}

		Pair (int x,int y){
			this.x=x;
			this.y=y;
		}

		public int compareTo(Pair o) {
			if(this.x!=o.x)
	                    return Integer.compare(this.x,o.x);
			else
	                    return Integer.compare(this.y,o.y);
			//return 0;
		}

        public boolean equals(Object o) {
            if (o instanceof Pair) {
                Pair p = (Pair)o;
                return p.x == x && p.y == y && p.i==i;
            }
            return false;
        }
        public int hashCode() {
            return new Integer(x).hashCode() * 31 + new Integer(y).hashCode()+new Integer(i).hashCode()*37;
        }

    }

    static String rev(String s) {
        StringBuilder sb = new StringBuilder(s);
        sb.reverse();
        return sb.toString();
    }

    static long gcd(long x, long y) {
        if (y == 0) {
            return x;
        } else {
            return gcd(y, x % y);
        }
    }

    static int gcd(int x, int y) {
        if (y == 0) {
            return x;
        } else {
            return gcd(y, x % y);
        }
    }

    static int abs(int a, int b) {
        return (int) Math.abs(a - b);
    }

    static long abs(long a, long b) {
        return (long) Math.abs(a - b);
    }

    static int max(int a, int b) {
        if (a > b) {
            return a;
        } else {
            return b;
        }
    }

    static int min(int a, int b) {
        if (a > b) {
            return b;
        } else {
            return a;
        }
    }

    static long max(long a, long b) {
        if (a > b) {
            return a;
        } else {
            return b;
        }
    }

    static long min(long a, long b) {
        if (a > b) {
            return b;
        } else {
            return a;
        }
    }

    static long pow(long n, long p, long m) {
        long result = 1;
        if (p == 0) {
            return 1;
        }
        while (p != 0) {
            if (p % 2 == 1) {
                result *= n;
            }
            if (result >= m) {
                result %= m;
            }
            p >>= 1;
            n *= n;
            if (n >= m) {
                n %= m;
            }
        }
        return result;
    }

    static long pow(long n, long p) {
        long result = 1;
        if (p == 0) {
            return 1;
        }
        if (p == 1) {
            return n;
        }
        while (p != 0) {
            if (p % 2 == 1) {
                result *= n;
            }
            p >>= 1;
            n *= n;
        }
        return result;
    }

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

    static class InputReader
    {

        private final InputStream stream;
        private final byte[] buf = new byte[8192];
        private int curChar, snumChars;
        private SpaceCharFilter filter;

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

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

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

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

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

        public long[] nextLongArray(int n)
        {
                long a[] = new long[n];
                for (int i = 0; i < n; i++)
                {
                        a[i] = nextLong();
                }
                return a;
        }

        public String readString()
        {
                int c = snext();
                while (isSpaceChar(c))
                {
                        c = snext();
                }
                StringBuilder res = new StringBuilder();
                do
                {
                        res.appendCodePoint(c);
                        c = snext();
                } while (!isSpaceChar(c));
                return res.toString();
        }

        public String nextLine()
        {
                int c = snext();
                while (isSpaceChar(c))
                        c = snext();
                StringBuilder res = new StringBuilder();
                do
                {
                        res.appendCodePoint(c);
                        c = snext();
                } while (!isEndOfLine(c));
                return res.toString();
        }

        public boolean isSpaceChar(int c)
        {
                if (filter != null)
                        return filter.isSpaceChar(c);
                return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

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

        public interface SpaceCharFilter
        {
                public boolean isSpaceChar(int ch);
        }

    }
}


import java.util.*;

import java.io.*;

public class B {

    static int mod = (int) (1e9+7);
    static InputReader in;
    static PrintWriter out;

    static void solve()
    {

        in = new InputReader(System.in);
        out = new PrintWriter(System.out);

        int t = 1;
        int maxn = 1000001;

        while(t-- > 0) {
        	int n = in.nextInt();
        	int[] count = new int[maxn];

        	int[] arr = new int[maxn];

        	for(int i = 1; i <= n; i++) {
        		int x = in.nextInt();
        		count[x]++;
        		arr[count[x]]++;
        	}
        	int q = in.nextInt();

        	while(q-- > 0) {
        		char c = in.readString().charAt(0);
        		int x = in.nextInt();

        		if(c == '+') {
        			count[x]++;
        			arr[count[x]]++;
        		}
        		else if(c == '-') {
        			arr[count[x]]--;
        			count[x]--;
        		}

        		boolean ok = (arr[8] >= 1);
        		ok |= (arr[6] >= 1 && arr[2] >= 2);
        		ok |= (arr[4] >= 2);
        		ok |= (arr[4] >= 1 && arr[2] >= 4);

//        		debug(arr);
        		out.println(ok? "YES": "NO");
        	}

        }

        out.close();

    }

    public static void main(String[] args) {
        new Thread(null ,new Runnable(){
            public void run()
            {
                try{
                    solve();
                } catch(Exception e){
                    e.printStackTrace();
                }
            }
        },"1",1<<26).start();
    }

    static int[][] graph(int from[], int to[], int n)
    {
        int g[][] = new int[n][];
        int cnt[] = new int[n];
        for (int i = 0; i < from.length; i++) {
            cnt[from[i]]++;
            cnt[to[i]]++;
        }
        for (int i = 0; i < n; i++) {
            g[i] = new int[cnt[i]];
        }
        Arrays.fill(cnt, 0);
        for (int i = 0; i < from.length; i++) {
            g[from[i]][cnt[from[i]]++] = to[i];
            g[to[i]][cnt[to[i]]++] = from[i];
        }
        return g;
    }

    static class Pair implements Comparable<Pair>{

        int x,y,i;

		Pair (int x,int y,int i){
			this.x=x;
			this.y=y;
			this.i=i;
		}

		Pair (int x,int y){
			this.x=x;
			this.y=y;
		}

		public int compareTo(Pair o) {
			if(this.x!=o.x)
	                    return Integer.compare(this.x,o.x);
			else
	                    return Integer.compare(this.y,o.y);
			//return 0;
		}

        public boolean equals(Object o) {
            if (o instanceof Pair) {
                Pair p = (Pair)o;
                return p.x == x && p.y == y && p.i==i;
            }
            return false;
        }
        public int hashCode() {
            return new Integer(x).hashCode() * 31 + new Integer(y).hashCode()+new Integer(i).hashCode()*37;
        }

    }

    static String rev(String s) {
        StringBuilder sb = new StringBuilder(s);
        sb.reverse();
        return sb.toString();
    }

    static long gcd(long x, long y) {
        if (y == 0) {
            return x;
        } else {
            return gcd(y, x % y);
        }
    }

    static int gcd(int x, int y) {
        if (y == 0) {
            return x;
        } else {
            return gcd(y, x % y);
        }
    }

    static int abs(int a, int b) {
        return (int) Math.abs(a - b);
    }

    static long abs(long a, long b) {
        return (long) Math.abs(a - b);
    }

    static int max(int a, int b) {
        if (a > b) {
            return a;
        } else {
            return b;
        }
    }

    static int min(int a, int b) {
        if (a > b) {
            return b;
        } else {
            return a;
        }
    }

    static long max(long a, long b) {
        if (a > b) {
            return a;
        } else {
            return b;
        }
    }

    static long min(long a, long b) {
        if (a > b) {
            return b;
        } else {
            return a;
        }
    }

    static long pow(long n, long p, long m) {
        long result = 1;
        if (p == 0) {
            return 1;
        }
        while (p != 0) {
            if (p % 2 == 1) {
                result *= n;
            }
            if (result >= m) {
                result %= m;
            }
            p >>= 1;
            n *= n;
            if (n >= m) {
                n %= m;
            }
        }
        return result;
    }

    static long pow(long n, long p) {
        long result = 1;
        if (p == 0) {
            return 1;
        }
        if (p == 1) {
            return n;
        }
        while (p != 0) {
            if (p % 2 == 1) {
                result *= n;
            }
            p >>= 1;
            n *= n;
        }
        return result;
    }

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

    static class InputReader
    {

        private final InputStream stream;
        private final byte[] buf = new byte[8192];
        private int curChar, snumChars;
        private SpaceCharFilter filter;

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

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

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

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

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

        public long[] nextLongArray(int n)
        {
                long a[] = new long[n];
                for (int i = 0; i < n; i++)
                {
                        a[i] = nextLong();
                }
                return a;
        }

        public String readString()
        {
                int c = snext();
                while (isSpaceChar(c))
                {
                        c = snext();
                }
                StringBuilder res = new StringBuilder();
                do
                {
                        res.appendCodePoint(c);
                        c = snext();
                } while (!isSpaceChar(c));
                return res.toString();
        }

        public String nextLine()
        {
                int c = snext();
                while (isSpaceChar(c))
                        c = snext();
                StringBuilder res = new StringBuilder();
                do
                {
                        res.appendCodePoint(c);
                        c = snext();
                } while (!isEndOfLine(c));
                return res.toString();
        }

        public boolean isSpaceChar(int c)
        {
                if (filter != null)
                        return filter.isSpaceChar(c);
                return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

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

        public interface SpaceCharFilter
        {
                public boolean isSpaceChar(int ch);
        }

    }
}


import java.util.*;
import java.io.*;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Collections;
import java.math.RoundingMode;
import java.text.DecimalFormat;
public class CopyOfB_Applejack_and_Storages
{
        static Scanner sc=new Scanner(System.in);
    static PrintWriter out=new PrintWriter(System.out);
    static void pn(Object o)
    {
    out.println(o);
    out.flush();

    }
    static void p(Object o)
    {
    out.print(o);
    out.flush();
    }
    static void pni(Object o)
    {
    out.println(o);System.out.flush();
    }
        static int I() throws IOException
    {
    return sc.nextInt();
    }
    static long L()throws IOException
    {
    return sc.nextLong();
    }
    static double D()throws IOException
    {
    return sc.nextDouble();
    }
    static String S()throws IOException
    {
    return sc.next();
        }
    public static void process() throws IOException
    {

        int n=I();
        int p[]=new int[n];
        for(int i=0;i<n;i++)
        {
            p[i]=I();
        }
        HashMap<Integer,Integer> count_4=new HashMap<Integer,Integer>();
        HashMap<Integer,Integer> count_2=new HashMap<Integer,Integer>();
        HashMap<Integer,Integer> count_8=new HashMap<Integer,Integer>();
        HashMap<Integer,Integer> count_6=new HashMap<Integer,Integer>();

        int q=I();
        int count[]=new int[100005];
        for(int i=0;i<n;i++)
        {
            count[p[i]]++;
        }
        for(int j=0;j<100001;j++)
        {
            int l=count[j];
            if((count[j]>=8))
            {
                count_8.put(j,count[j]);
            }
            else
            if(count[j]>=6)
            {
                count_6.put(j,count[j]);
            }
            else
            if(count[j]>=4)
            {

                count_4.put(j,count[j]);
            }
            else
            if((count[j]>=2))
            {
                count_2.put(j,count[j]);

            }
        }
        for(int i=0;i<q;i++)
        {

            char ch=sc.next().charAt(0);

                int k=I();int m=0;
             if(ch=='+')
               m=+1;
                else
                if(ch=='-')
               m=-1;

            if(count[k]>=8)
            {
                count_8.remove(k);
            }
            else
            if(count[k]>=6)
            {
                count_6.remove(k);
            }
            else
            if(count[k]>=4)
            {
                count_4.remove(k);
            }
            else
            if(count[k]>=2)
            {
                count_2.remove(k);
            }
            count[k]=count[k]+m;
            if(count[k]>=8)
            {
                count_8.put(k,count[k]);
            }
            else
            if(count[k]>=6)
            {
                count_6.put(k,count[k]);
            }
            else
            if(count[k]>=4)
            {
                count_4.put(k,count[k]);
            }
            else
             if(count[k]>=2)
            {
                count_2.put(k,count[k]);
            }

            if((count_8.size()>0) || (count_6.size()>0 && count_2.size()>0) ||(count_4.size()>0&&count_6.size()>0)||(count_4.size()>=2)||( count_4.size()>=1 && count_2.size()>1) )
            {
                pn("YES");
            }
            else
            {
                pn("NO");
            }
        }

  }
  public static void main(String[] args) throws IOException
    {

      process();

}
}


import java.util.*;
import java.io.*;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Collections;
import java.math.RoundingMode;
import java.text.DecimalFormat;
public class CopyOfB_Applejack_and_Storages
{
        static Scanner sc=new Scanner(System.in);
    static PrintWriter out=new PrintWriter(System.out);
    static void pn(Object o)
    {
    out.println(o);
    out.flush();

    }
    static void p(Object o)
    {
    out.print(o);
    out.flush();
    }
    static void pni(Object o)
    {
    out.println(o);System.out.flush();
    }
        static int I() throws IOException
    {
    return sc.nextInt();
    }
    static long L()throws IOException
    {
    return sc.nextLong();
    }
    static double D()throws IOException
    {
    return sc.nextDouble();
    }
    static String S()throws IOException
    {
    return sc.next();
        }
    public static void process() throws IOException
    {

        int n=I();
        int p[]=new int[n];
        for(int i=0;i<n;i++)
        {
            p[i]=I();
        }
        HashMap<Integer,Integer> count_4=new HashMap<Integer,Integer>();
        HashMap<Integer,Integer> count_2=new HashMap<Integer,Integer>();
        HashMap<Integer,Integer> count_8=new HashMap<Integer,Integer>();
        HashMap<Integer,Integer> count_6=new HashMap<Integer,Integer>();

        int q=I();
        int count[]=new int[100005];
        for(int i=0;i<n;i++)
        {
            count[p[i]]++;
        }
        for(int j=0;j<100001;j++)
        {
            int l=count[j];
            if((count[j]>=8))
            {
                count_8.put(j,count[j]);
            }
            else
            if(count[j]>=6)
            {
                count_6.put(j,count[j]);
            }
            else
            if(count[j]>=4)
            {

                count_4.put(j,count[j]);
            }
            else
            if((count[j]>=2))
            {
                count_2.put(j,count[j]);

            }
        }
        for(int i=0;i<q;i++)
        {

            char ch=sc.next().charAt(0);

                int k=I();int m=0;
             if(ch=='+')
               m=+1;
                else
                if(ch=='-')
               m=-1;

            if(count[k]>=8)
            {
                count_8.remove(k);
            }
            else
            if(count[k]>=6)
            {
                count_6.remove(k);
            }
            else
            if(count[k]>=4)
            {
                count_4.remove(k);
            }
            else
            if(count[k]>=2)
            {
                count_2.remove(k);
            }
            count[k]=count[k]+m;
            if(count[k]>=8)
            {
                count_8.put(k,count[k]);
            }
            else
            if(count[k]>=6)
            {
                count_6.put(k,count[k]);
            }
            else
            if(count[k]>=4)
            {
                count_4.put(k,count[k]);
            }
            else
             if(count[k]>=2)
            {
                count_2.put(k,count[k]);
            }

            if((count_8.size()>0) || (count_6.size()>0 && count_2.size()>0) ||(count_6.size()>=2) ||(count_4.size()>0&&count_6.size()>0)||(count_4.size()>=2)||( count_4.size()>=1 && count_2.size()>1) )
            {
                pn("YES");
            }
            else
            {
                pn("NO");
            }
        }

  }
  public static void main(String[] args) throws IOException
    {

      process();

}
}


import java.util.*;
import java.io.*;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Collections;
import java.math.RoundingMode;
import java.text.DecimalFormat;
public class B_Applejack_and_Storages
{
        static Scanner sc=new Scanner(System.in);
    static PrintWriter out=new PrintWriter(System.out);
    static void pn(Object o)
    {
    out.println(o);
    out.flush();

    }
    static void p(Object o)
    {
    out.print(o);
    out.flush();
    }
    static void pni(Object o)
    {
    out.println(o);System.out.flush();
    }
        static int I() throws IOException
    {
    return sc.nextInt();
    }
    static long L()throws IOException
    {
    return sc.nextLong();
    }
    static double D()throws IOException
    {
    return sc.nextDouble();
    }
    static String S()throws IOException
    {
    return sc.next();
        }
    public static void process() throws IOException
    {
        int n=I();
        int p[]=new int[n];
        for(int i=0;i<n;i++)
        {
            p[i]=I();
        }
        HashMap<Integer,Integer> count_4=new HashMap<Integer,Integer>();
        HashMap<Integer,Integer> count_2=new HashMap<Integer,Integer>();
        HashMap<Integer,Integer> count_8=new HashMap<Integer,Integer>();
        HashMap<Integer,Integer> count_6=new HashMap<Integer,Integer>();

        int q=I();
        int count[]=new int[100000];
        for(int i=0;i<n;i++)
        {
            count[p[i]]++;
        }
        for(int j=0;j<100000;j++)
        {
            int l=count[j];
            if((count[j]%4==0 || count[j]>=4)&& count[j]!=0)
            {

                count_4.put(j,l);
            }
            else
            if(count[j]%2==0 && count[j]!=0)
            {
                count_2.put(j,count[j]);
                if((count[j]-2)%4==0)
                {
                    count_4.put(j,count[j]);
                }
            }
        }
        for(int i=0;i<q;i++)
        {
            String s=S(); char ch=0;  String ch1="";
               ch1=s.substring(1);

            ch=s.charAt(0);

                int k=Integer.parseInt(ch1);

             if(ch=='+')
                count[k]++;
                else
                if(ch=='-')
                {
                    count[k]--;
                }
                 if(count[k]%4==0 && count[k]!=0)
            {
                count_4.put(k,count[k]);
            }
            else
            if(count[k]%2==0 && count[k]!=0)
            {
                count_2.put(k,count[k]);
                if((count[k]-2)%4==0)
                {
                    count_4.put(k,count[k]);
                }
            }

            if(count[k]%4!=0 && count_4.containsKey(k))
            {
                count_4.remove(k);
            }
            else
            if(count[k]%2!=0 && count_2.containsKey(k))
            {
                count_2.remove(k);
            }
            pn("count\t"+count[k]+"\t"+k);
            pn("count_4\t"+count_4.size()+"\tcount_2\t"+count_2.size());
            if(count_4.size()>=1 && count_2.size()>=2)
            {
                pn("YES");
            }
            else
            {
                pn("NO");
            }
        }
}
    public static void main(String[] args) throws IOException
    {
      process();
    }
}


import java.util.*;
import java.io.*;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Collections;
import java.math.RoundingMode;
import java.text.DecimalFormat;
public class CopyOfB_Applejack_and_Storages
{
        static Scanner sc=new Scanner(System.in);
    static PrintWriter out=new PrintWriter(System.out);
    static void pn(Object o)
    {
    out.println(o);
    out.flush();

    }
    static void p(Object o)
    {
    out.print(o);
    out.flush();
    }
    static void pni(Object o)
    {
    out.println(o);System.out.flush();
    }
        static int I() throws IOException
    {
    return sc.nextInt();
    }
    static long L()throws IOException
    {
    return sc.nextLong();
    }
    static double D()throws IOException
    {
    return sc.nextDouble();
    }
    static String S()throws IOException
    {
    return sc.next();
        }
    public static void process() throws IOException
    {
        int n=I();
        int p[]=new int[n];
        for(int i=0;i<n;i++)
        {
            p[i]=I();
        }
        HashMap<Integer,Integer> count_4=new HashMap<Integer,Integer>();
        HashMap<Integer,Integer> count_2=new HashMap<Integer,Integer>();
        HashMap<Integer,Integer> count_8=new HashMap<Integer,Integer>();
        HashMap<Integer,Integer> count_6=new HashMap<Integer,Integer>();

        int q=I();
        int count[]=new int[100005];
        for(int i=0;i<n;i++)
        {
            count[p[i]]++;
        }
        for(int j=0;j<100001;j++)
        {
            int l=count[j];
            if((count[j]>=8))
            {
                count_8.put(j,count[j]);
            }
            else
            if(count[j]>=6)
            {
                count_6.put(j,count[j]);
            }
            else
            if(count[j]>=4)
            {

                count_4.put(j,count[j]);
            }
            else
            if((count[j]>=2))
            {
                count_2.put(j,count[j]);

            }
        }
        for(int i=0;i<q;i++)
        {
            String s=S(); char ch=0;  String ch1="";
               ch1=s.substring(1);

            ch=s.charAt(0);
               int m=0;
                int k=Integer.parseInt(ch1);
            if(ch=='+')
               m=+1;
                else
                if(ch=='-')
               m=-1;

            if(count[k]>=8)
            {
                count_8.remove(k);
            }
            else
            if(count[k]>=6)
            {
                count_6.remove(k);
            }
            else
            if(count[k]>=4)
            {
                count_4.remove(k);
            }
            else
            if(count[k]>=2)
            {
                count_2.remove(k);
            }
            count[k]=count[k]+m;
            if(count[k]>=8)
            {
                count_8.put(k,count[k]);
            }
            else
            if(count[k]>=6)
            {
                count_6.put(k,count[k]);
            }
            else
            if(count[k]>=4)
            {
                count_4.put(k,count[k]);
            }
            else
             if(count[k]>=2)
            {
                count_2.put(k,count[k]);
            }

            if((count_8.size()>0) || (count_6.size()>0 && count_2.size()>0) ||(count_4.size()>0&&count_6.size()>0)||(count_4.size()>=2)||( count_4.size()>=1 && count_2.size()>1) )
            {
                pn("YES");
            }
            else
            {
                pn("NO");
            }

 }
}
    public static void main(String[] args) throws IOException
    {
        try
        {

      process();
     }
     catch(Exception e)
     {
         return;
        }
}
}


import java.util.*;
import java.io.*;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Collections;
import java.math.RoundingMode;
import java.text.DecimalFormat;
public class CopyOfB_Applejack_and_Storages
{
        static Scanner sc=new Scanner(System.in);
    static PrintWriter out=new PrintWriter(System.out);
    static void pn(Object o)
    {
    out.println(o);
    out.flush();

    }
    static void p(Object o)
    {
    out.print(o);
    out.flush();
    }
    static void pni(Object o)
    {
    out.println(o);System.out.flush();
    }
        static int I() throws IOException
    {
    return sc.nextInt();
    }
    static long L()throws IOException
    {
    return sc.nextLong();
    }
    static double D()throws IOException
    {
    return sc.nextDouble();
    }
    static String S()throws IOException
    {
    return sc.next();
        }
    public static void process() throws IOException
    {
        int n=I();
        int p[]=new int[n];
        for(int i=0;i<n;i++)
        {
            p[i]=I();
        }
        HashMap<Integer,Integer> count_4=new HashMap<Integer,Integer>();
        HashMap<Integer,Integer> count_2=new HashMap<Integer,Integer>();
        HashMap<Integer,Integer> count_8=new HashMap<Integer,Integer>();
        HashMap<Integer,Integer> count_6=new HashMap<Integer,Integer>();

        int q=I();
        int count[]=new int[100000];
        for(int i=0;i<n;i++)
        {
            count[p[i]]++;
        }
        for(int j=0;j<100000;j++)
        {
            int l=count[j];
            if((count[j]>=8))
            {
                count_8.put(j,count[j]);
            }
            else
            if(count[j]>=6)
            {
                count_6.put(j,count[j]);
            }
            else
            if(count[j]>=4)
            {

                count_4.put(j,count[j]);
            }
            else
            if((count[j]>=2))
            {
                count_2.put(j,count[j]);

            }
        }
        for(int i=0;i<q;i++)
        {
            String s=S(); char ch=0;  String ch1="";
               ch1=s.substring(1);

            ch=s.charAt(0);
               int m=0;
                int k=Integer.parseInt(ch1);
            if(ch=='+')
               m=+1;
                else
                if(ch=='-')
               m=-1;

            if(count[k]>=8)
            {
                count_8.remove(k);
            }
            else
            if(count[k]>=6)
            {
                count_6.remove(k);
            }
            else
            if(count[k]>=4)
            {
                count_4.remove(k);
            }
            else
            if(count[k]>=2)
            {
                count_2.remove(k);
            }
            count[k]=count[k]+m;
            if(count[k]>=8)
            {
                count_8.put(k,count[k]);
            }
            else
            if(count[k]>=6)
            {
                count_6.put(k,count[k]);
            }
            else
            if(count[k]>=4)
            {
                count_4.put(k,count[k]);
            }
            else
             if(count[k]>=2)
            {
                count_2.put(k,count[k]);
            }

            if((count_8.size()>0) || (count_6.size()>0 && count_2.size()>0) ||(count_4.size()>0&&count_6.size()>0)||(count_4.size()>=2)||( count_4.size()>=1 && count_2.size()>1) )
            {
                pn("YES");
            }
            else
            {
                pn("NO");
            }

 }
}
    public static void main(String[] args) throws IOException
    {
      process();
    }
}


import java.util.*;
import java.io.*;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Collections;
import java.math.RoundingMode;
import java.text.DecimalFormat;
public class CopyOfB_Applejack_and_Storages
{
        static Scanner sc=new Scanner(System.in);
    static PrintWriter out=new PrintWriter(System.out);
    static void pn(Object o)
    {
    out.println(o);
    out.flush();

    }
    static void p(Object o)
    {
    out.print(o);
    out.flush();
    }
    static void pni(Object o)
    {
    out.println(o);System.out.flush();
    }
        static int I() throws IOException
    {
    return sc.nextInt();
    }
    static long L()throws IOException
    {
    return sc.nextLong();
    }
    static double D()throws IOException
    {
    return sc.nextDouble();
    }
    static String S()throws IOException
    {
    return sc.next();
        }
    public static void process() throws IOException
    {
        int n=I();
        int p[]=new int[n];
        for(int i=0;i<n;i++)
        {
            p[i]=I();
        }
        HashMap<Integer,Integer> count_4=new HashMap<Integer,Integer>();
        HashMap<Integer,Integer> count_2=new HashMap<Integer,Integer>();
        HashMap<Integer,Integer> count_8=new HashMap<Integer,Integer>();
        HashMap<Integer,Integer> count_6=new HashMap<Integer,Integer>();

        int q=I();
        int count[]=new int[100000];
        for(int i=0;i<n;i++)
        {
            count[p[i]]++;
        }
        for(int j=0;j<100000;j++)
        {
            int l=count[j];
            if((count[j]>=8))
            {
                count_8.put(j,count[j]);
            }
            else
            if(count[j]>=6)
            {
                count_6.put(j,count[j]);
            }
            else
            if(count[j]>=4)
            {

                count_4.put(j,count[j]);
            }
            else
            if((count[j]>=2))
            {
                count_2.put(j,count[j]);

            }
        }
        for(int i=0;i<q;i++)
        {
            String s=S(); char ch=0;  String ch1="";
               ch1=s.substring(1);

            ch=s.charAt(0);
               int m=0;
                int k=Integer.parseInt(ch1);
            if(ch=='+')
               m=+1;
                else
                if(ch=='-')
               m=-1;

            if(count[k]>=8)
            {
                count_8.remove(k);
            }
            else
            if(count[k]>=6)
            {
                count_6.remove(k);
            }
            else
            if(count[k]>=4)
            {
                count_4.remove(k);
            }
            else
            if(count[k]>=2)
            {
                count_2.remove(k);
            }
            count[k]=count[k]+m;
            if(count[k]>=8)
            {
                count_8.put(k,count[k]);
            }
            else
            if(count[k]>=6)
            {
                count_6.put(k,count[k]);
            }
            else
            if(count[k]>=4)
            {
                count_4.put(k,count[k]);
            }
            else
             if(count[k]>=2)
            {
                count_2.put(k,count[k]);
            }

            if((count_8.size()>0) || (count_6.size()>0 && count_2.size()>0) ||(count_4.size()>0&&count_6.size()>0)||(count_4.size()>=2)||( count_4.size()>=1 && count_2.size()>1) )
            {
                pn("YES");
            }
            else
            {
                pn("NO");
            }

 }
}
    public static void main(String[] args) throws IOException
    {
        try
        {

      process();
     }
     catch(Exception e)
     {
         return;
        }
}
}


		import java.math.BigInteger;
		import java.util.ArrayList;
		import java.util.Arrays;
	import java.util.Collection;
	import java.util.Collections;
	import java.util.Comparator;
	import java.util.HashMap;
		import java.util.Iterator;
	import java.util.LinkedList;
	import java.util.List;
	import java.util.Map;
import java.util.Map.Entry;
import java.util.PriorityQueue;
	import java.util.Scanner;
	import java.util.Set;
	import java.util.Stack;
	import java.io.BufferedReader;
	import java.io.IOException;
	import java.io.InputStreamReader;
	import java.util.Scanner;
	import java.util.StringTokenizer;
	import java.util.TreeMap;
	import java.util.TreeSet;

		public class Main {

			static FastReader sc= new FastReader();
			static List<Integer> C;
			static List<Long> B;
		static	int mod=(int)Math.pow(10, 9)+7;

			public static void main(String[] args) {

				int n=sc.nextInt();
				C=new ArrayList<Integer>();
				HashMap<Integer,Long> map=new HashMap<>();
				HashMap<Integer,Integer> six=new HashMap<>();
				HashMap<Integer,Integer> two=new HashMap<>();
				HashMap<Integer,Integer> fours=new HashMap<>();

				for(int i=0;i<n;i++) {
					C.add(sc.nextInt());
					if(!map.containsKey(C.get(i)))map.put(C.get(i),1l);
					else map.put(C.get(i),map.get(C.get(i))+1);
				}
				for(HashMap.Entry<Integer, Long> i:map.entrySet()) {

						if(i.getValue()>=6)six.put(i.getKey(),1);
						if(i.getValue()>=2)six.put(i.getKey(),1);
						if(i.getValue()>=4)fours.put(i.getKey(),1);
						}

				int m=sc.nextInt();
				while(m-->0) {
					String q=sc.next();
				//	System.out.println(q);
					int val=sc.nextInt();
					//int val=Integer.parseInt(q.substring(1,q.length()));
					if(q.charAt(0)=='-') {

						if(map.containsKey(val)) {
							map.put(val, map.get(val)-1);
						}
						if(six.containsKey(val)&&map.get(val)<6)six.remove(val);
						if(two.containsKey(val)&&map.get(val)<2)two.remove(val);
						if(fours.containsKey(val)&&map.get(val)<4)fours.remove(val);

					}
					if(q.charAt(0)=='+') {

						if(map.containsKey(val)) {
							map.put(val, map.get(val)+1);
						}
						else map.put(val, 1l);
						if(map.get(val)>=6)six.put(val,1);
						if(map.get(val)>=2)two.put(val,1);
						if(map.get(val)>=4)fours.put(val,1);
					}
					//System.out.println(map);

					if(fours.size()>=2) {System.out.println("YES");continue;}
					if(six.size()>=1&&two.size()>=2)System.out.println("YES");
					else if(fours.size()>=1&&two.size()>=3)System.out.println("YES");
					else System.out.println("NO");

				}

			}

			static boolean isSubsetSum(int set[],  int n, int sum)
	{
	// The value of subset[i][j] will be
	// true if there is a subset of
	// set[0..j-1] with sum equal to i
	boolean subset[][] = new boolean[sum + 1][n + 1];

	// If sum is 0, then answer is true
	for (int i = 0; i <= n; i++)
	subset[0][i] = true;

	// If sum is not 0 and set is empty,
	// then answer is false
	for (int i = 1; i <= sum; i++)
	subset[i][0] = false;

	// Fill the subset table in botton
	// up manner
	for (int i = 1; i <= sum; i++) {
	for (int j = 1; j <= n; j++) {
	    subset[i][j] = subset[i][j - 1];
	    if (i >= set[j - 1])
	        subset[i][j] = subset[i][j]
	                       || subset[i - set[j - 1]][j - 1];
	}
	}

	return subset[sum][n];
	}

			static boolean search(ArrayList<Integer> a,int m,int h) {
				PriorityQueue<Integer> p=new PriorityQueue<Integer>(new Comparator<Integer>() {
						@Override
						public int compare(Integer o1, Integer o2) {
							// TODO Auto-generated method stub
							return o2-o1;
						}
				});

				for(int i=0;i<m;i++) {
					p.add(a.get(i));
				}
				int c=0;
				//System.out.println(p);
				while(!p.isEmpty()) {
					//System.out.println(p);

					h-=p.poll();
					if(h<0)break;

					c++;

				//	System.out.println(h+" "+p+" "+c+" "+m);

					if(!p.isEmpty()) {
					p.poll();
					c++;}

				}
			//	System.out.println(c!=m);
				if(c!=m)return false;

				return true;
			}
		//	static int  key=-1;

			static boolean isPowerOfTwo(long n)
		    {
		        if (n == 0)
		            return false;

		        while (n != 1)
		        {
		            if (n % 2 != 0)
		                return false;
		            n = n / 2;
		        }
		        return true;
		    }

			 static boolean isPerfectSquare(double x)
			    {

			        // Find floating point value of
			        // square root of x.
			        double sr = Math.sqrt(x);

			        // If square root is an integer
			        return ((sr - Math.floor(sr)) == 0);
			    }

		static	int binarySearch(ArrayList<Long> arr, int l, int r, long x,int key)
		    {
		        if (r >= l) {
		            int mid =  (r + l) / 2;
		//  if(mid>=arr.size())return -1;
		            // If the element is present at the
		            // middle itself

		            if (arr.get(mid) == x)
		                return mid+1;

		            // If element is smaller than mid, then
		            // it can only be present in left subarray
		            if (arr.get(mid) > x) {
		                return binarySearch(arr, l, mid - 1, x,key);
		            }
		            // Else the element can only be present
		            // in right subarray
		            key=mid+1;
		            return binarySearch(arr, mid + 1, r, x,key);
		        }

		        // We reach here when element is not present
		        // in array
		        return key;
		    }

		    static boolean isPrime(long n)
		    {
		        // Corner cases
		        if (n <= 1)
		            return false;
		        if (n <= 3)
		            return true;

		        // This is checked so that we can skip
		        // middle five numbers in below loop
		        if (n % 2 == 0 || n % 3 == 0)
		            return false;

		        for (int i = 5; i * i <= n; i = i + 6)
		            if (n % i == 0 || n % (i + 2) == 0)
		                return false;

		        return true;
		    }

		    static class FastReader
		    {
		        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;
		        }
		    }

		}

		class Sol {

			int value;int in;int i;
			Sol(int value,int in,int i){
				this.value=value;
				this.in=in;
				this.i=i;
			}

	}

 class SegmentTree {

	SegNode st[];
	int n;
//	long arr[];
	public SegmentTree(int n) {
			this.n=n;
		//this.arr=arr;
		st=new SegNode[4*n];

	}

	void init(long n) {

		for(int i=0;i<4*n;i++) {
			st[i]=new SegNode();
		}

	}

	void set(int i,long v,int x,int lx,int rx) {

		if(rx-lx==1) {
			st[x].sum=v;
			st[x].max=v;
			return ;
		}
		int m=lx+(rx-lx)/2;
		if(i<m) set(i,v,2*x+1,lx,m);
		else set(i,v,2*x+2,m,rx);

		st[x].sum=st[2*x+1].sum+st[2*x+2].sum;
		long ma=Math.max(st[2*x+1].max,st[2*x+2].max);
			st[x].max=Math.max(ma,st[x].sum);
	}

	void set (int i,long v) {
		set(i,v,0,0,n);
	}

	long max=Integer.MIN_VALUE;
long sum(int l,int r,int x,int lx,int rx) {
	if(lx>=r||l>=rx)return 0;
	if(lx>=l||rx<=r)return st[x].sum;

		int m=(rx+lx)/2;

		long s1=sum(l,r,2*x+1,lx,m);
		long s2=sum(l,r,2*x+2,m,rx);

		return max= Math.max(Math.max(Math.max(s1,s2),s1+s2),max);

	}
	long sum(int l,int r) {
		return sum(l,r,0,0,n);
	}

}
	class SegNode{
		long max;long sum;
		public SegNode() {
			// TODO Auto-generated constructor stub
			sum=0;
			max=Integer.MIN_VALUE;

		}
	}


		import java.math.BigInteger;
		import java.util.ArrayList;
		import java.util.Arrays;
	import java.util.Collection;
	import java.util.Collections;
	import java.util.Comparator;
	import java.util.HashMap;
		import java.util.Iterator;
	import java.util.LinkedList;
	import java.util.List;
	import java.util.Map;
import java.util.Map.Entry;
import java.util.PriorityQueue;
	import java.util.Scanner;
	import java.util.Set;
	import java.util.Stack;
	import java.io.BufferedReader;
	import java.io.IOException;
	import java.io.InputStreamReader;
	import java.util.Scanner;
	import java.util.StringTokenizer;
	import java.util.TreeMap;
	import java.util.TreeSet;

		public class Main {

			static FastReader sc= new FastReader();
			static List<Integer> C;
			static List<Long> B;
		static	int mod=(int)Math.pow(10, 9)+7;

			public static void main(String[] args) {

				int n=sc.nextInt();
				C=new ArrayList<Integer>();
				HashMap<Integer,Long> map=new HashMap<>();
				HashMap<Integer,Integer> six=new HashMap<>();
				HashMap<Integer,Integer> two=new HashMap<>();
				HashMap<Integer,Integer> fours=new HashMap<>();

				for(int i=0;i<n;i++) {
					C.add(sc.nextInt());
					if(!map.containsKey(C.get(i)))map.put(C.get(i),1l);
					else map.put(C.get(i),map.get(C.get(i))+1);
				}
				for(HashMap.Entry<Integer, Long> i:map.entrySet()) {

						if(i.getValue()>=6)six.put(i.getKey(),1);
						if(i.getValue()>=2)two.put(i.getKey(),1);
						if(i.getValue()>=4)fours.put(i.getKey(),1);
						}

				int m=sc.nextInt();
				while(m-->0) {
					String q=sc.next();
				//	System.out.println(q);
					int val=sc.nextInt();
					//int val=Integer.parseInt(q.substring(1,q.length()));
					if(q.charAt(0)=='-') {

						if(map.containsKey(val)) {
							map.put(val, map.get(val)-1);
						}
						if(six.containsKey(val)&&map.get(val)<6)six.remove(val);
						if(two.containsKey(val)&&map.get(val)<2)two.remove(val);
						if(fours.containsKey(val)&&map.get(val)<4)fours.remove(val);

					}
					if(q.charAt(0)=='+') {

						if(map.containsKey(val)) {
							map.put(val, map.get(val)+1);
						}
						else map.put(val, 1l);
						if(map.get(val)>=6)six.put(val,1);
						if(map.get(val)>=2)two.put(val,1);
						if(map.get(val)>=4)fours.put(val,1);
					}
					//System.out.println(map);

					if(fours.size()>=2) {System.out.println("YES");continue;}
					if(six.size()>=1&&two.size()>=2)System.out.println("YES");
					else if(fours.size()>=1&&two.size()>=3)System.out.println("YES");
					else System.out.println("NO");

				}

			}

			static boolean isSubsetSum(int set[],  int n, int sum)
	{
	// The value of subset[i][j] will be
	// true if there is a subset of
	// set[0..j-1] with sum equal to i
	boolean subset[][] = new boolean[sum + 1][n + 1];

	// If sum is 0, then answer is true
	for (int i = 0; i <= n; i++)
	subset[0][i] = true;

	// If sum is not 0 and set is empty,
	// then answer is false
	for (int i = 1; i <= sum; i++)
	subset[i][0] = false;

	// Fill the subset table in botton
	// up manner
	for (int i = 1; i <= sum; i++) {
	for (int j = 1; j <= n; j++) {
	    subset[i][j] = subset[i][j - 1];
	    if (i >= set[j - 1])
	        subset[i][j] = subset[i][j]
	                       || subset[i - set[j - 1]][j - 1];
	}
	}

	return subset[sum][n];
	}

			static boolean search(ArrayList<Integer> a,int m,int h) {
				PriorityQueue<Integer> p=new PriorityQueue<Integer>(new Comparator<Integer>() {
						@Override
						public int compare(Integer o1, Integer o2) {
							// TODO Auto-generated method stub
							return o2-o1;
						}
				});

				for(int i=0;i<m;i++) {
					p.add(a.get(i));
				}
				int c=0;
				//System.out.println(p);
				while(!p.isEmpty()) {
					//System.out.println(p);

					h-=p.poll();
					if(h<0)break;

					c++;

				//	System.out.println(h+" "+p+" "+c+" "+m);

					if(!p.isEmpty()) {
					p.poll();
					c++;}

				}
			//	System.out.println(c!=m);
				if(c!=m)return false;

				return true;
			}
		//	static int  key=-1;

			static boolean isPowerOfTwo(long n)
		    {
		        if (n == 0)
		            return false;

		        while (n != 1)
		        {
		            if (n % 2 != 0)
		                return false;
		            n = n / 2;
		        }
		        return true;
		    }

			 static boolean isPerfectSquare(double x)
			    {

			        // Find floating point value of
			        // square root of x.
			        double sr = Math.sqrt(x);

			        // If square root is an integer
			        return ((sr - Math.floor(sr)) == 0);
			    }

		static	int binarySearch(ArrayList<Long> arr, int l, int r, long x,int key)
		    {
		        if (r >= l) {
		            int mid =  (r + l) / 2;
		//  if(mid>=arr.size())return -1;
		            // If the element is present at the
		            // middle itself

		            if (arr.get(mid) == x)
		                return mid+1;

		            // If element is smaller than mid, then
		            // it can only be present in left subarray
		            if (arr.get(mid) > x) {
		                return binarySearch(arr, l, mid - 1, x,key);
		            }
		            // Else the element can only be present
		            // in right subarray
		            key=mid+1;
		            return binarySearch(arr, mid + 1, r, x,key);
		        }

		        // We reach here when element is not present
		        // in array
		        return key;
		    }

		    static boolean isPrime(long n)
		    {
		        // Corner cases
		        if (n <= 1)
		            return false;
		        if (n <= 3)
		            return true;

		        // This is checked so that we can skip
		        // middle five numbers in below loop
		        if (n % 2 == 0 || n % 3 == 0)
		            return false;

		        for (int i = 5; i * i <= n; i = i + 6)
		            if (n % i == 0 || n % (i + 2) == 0)
		                return false;

		        return true;
		    }

		    static class FastReader
		    {
		        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;
		        }
		    }

		}

		class Sol {

			int value;int in;int i;
			Sol(int value,int in,int i){
				this.value=value;
				this.in=in;
				this.i=i;
			}

	}

 class SegmentTree {

	SegNode st[];
	int n;
//	long arr[];
	public SegmentTree(int n) {
			this.n=n;
		//this.arr=arr;
		st=new SegNode[4*n];

	}

	void init(long n) {

		for(int i=0;i<4*n;i++) {
			st[i]=new SegNode();
		}

	}

	void set(int i,long v,int x,int lx,int rx) {

		if(rx-lx==1) {
			st[x].sum=v;
			st[x].max=v;
			return ;
		}
		int m=lx+(rx-lx)/2;
		if(i<m) set(i,v,2*x+1,lx,m);
		else set(i,v,2*x+2,m,rx);

		st[x].sum=st[2*x+1].sum+st[2*x+2].sum;
		long ma=Math.max(st[2*x+1].max,st[2*x+2].max);
			st[x].max=Math.max(ma,st[x].sum);
	}

	void set (int i,long v) {
		set(i,v,0,0,n);
	}

	long max=Integer.MIN_VALUE;
long sum(int l,int r,int x,int lx,int rx) {
	if(lx>=r||l>=rx)return 0;
	if(lx>=l||rx<=r)return st[x].sum;

		int m=(rx+lx)/2;

		long s1=sum(l,r,2*x+1,lx,m);
		long s2=sum(l,r,2*x+2,m,rx);

		return max= Math.max(Math.max(Math.max(s1,s2),s1+s2),max);

	}
	long sum(int l,int r) {
		return sum(l,r,0,0,n);
	}

}
	class SegNode{
		long max;long sum;
		public SegNode() {
			// TODO Auto-generated constructor stub
			sum=0;
			max=Integer.MIN_VALUE;

		}
	}