import java.util.*;

import java.io.*;

public class Prb83 {

    static FastReader sc = new FastReader();

    public static void main(String[] args) {

        int t = sc.nextInt();
        while(t--!=0){
            int n = sc.nextInt();
            int m = sc.nextInt();
            int arr[] = sc.readArray(n);
            int sum = 0;
            for(int i = 0 ; i < n ; i++){
                sum+=arr[i];
            }
            if(sum%m == 0){
                System.out.println("YES");
            }else{
                System.out.println("NO");
            }
        }

    }

    static class FastReader
    {
        BufferedReader br;
        StringTokenizer st;

        public FastReader()
        {   try{

            File file =  new File("input.txt");
            br = new BufferedReader(new
            InputStreamReader(new FileInputStream(file)));

        }catch(Exception e){
            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;
        }

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

}


//package CodeForces.Round678Div2;

import java.io.*;import java.util.*;import java.math.*;
public class A
{
    static long mod=1000000007l;
    static int max=Integer.MAX_VALUE,min=Integer.MIN_VALUE;
    static long maxl=Long.MAX_VALUE,minl=Long.MIN_VALUE;
    static BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
    static StringTokenizer st;
    static StringBuilder sb;

    static public void main(String[] args)throws Exception
    {
        st=new StringTokenizer(br.readLine());
        int t=i();
        sb=new StringBuilder(1000000);

        while(t-->0) {
            int n = i() ;int m = i() ;
            int[] a = ari(n) ;
            long ans = 0 ;
            for(int i=0;i<n;i++){
                ans+=a[i] ;
            }
            if(ans == m) sl("YES") ;
            else sl("NO");

        }
        p(sb) ;
    }

    static void s(String s){sb.append(s);}
    static void s(int s){sb.append(s);}
    static void s(long s){sb.append(s);}
    static void s(char s){sb.append(s);}
    static void s(double s){sb.append(s);}
    static void ss(){sb.append(' ');}
    static void sl(String s){sb.append(s);sb.append("\n");}
    static void sl(int s){sb.append(s);sb.append("\n");}
    static void sl(long s){sb.append(s);sb.append("\n");}
    static void sl(char s){sb.append(s);sb.append("\n");}
    static void sl(double s){sb.append(s);sb.append("\n");}
    static void sl(){sb.append("\n");}
    static int max(int a,int b){return a>b?a:b;}
    static int min(int a,int b){return a<b?a:b;}
    static int abs(int a){return Math.abs(a);}
    static int floor(int a){return (int)Math.floor(a);}
    static int ceil(int a){return (int)Math.ceil(a);}
    static long max(long a,long b){return a>b?a:b;}
    static long min(long a,long b){return a<b?a:b;}
    static long abs(long a){return Math.abs(a);}
    static int sq(int a){return (int)Math.sqrt(a);}
    static long sq(long a){return (long)Math.sqrt(a);}
    static int gcd(int a,int b){return b==0?a:gcd(b,a%b);}
    static boolean pa(String s,int i,int j)
    {
        while(i<j)if(s.charAt(i++)!=s.charAt(j--))return false;
        return true;
    }
    static int ncr(int n,int c,long m)
    {
        long a=1l;
        for(int x=n-c+1;x<=n;x++)a=((a*x)%m);
        long b=1l;
        for(int x=2;x<=c;x++)b=((b*x)%m);
        return (int)((a*(mul((int)b,m-2,m)%m))%m);
    }
    static boolean[] sieve(int n)
    {
        boolean bo[]=new boolean[n+1];
        bo[0]=true;bo[1]=true;
        for(int x=4;x<=n;x+=2)bo[x]=true;
        for(int x=3;x*x<=n;x+=2)if(!bo[x])for(int y=x*x;y<=n;y+=x)bo[y]=true;
        return bo;
    }
    static long fac(long n){
        if(n==0 || n==1) return 1 ;
        else return 1L*n*fac(n-1) ;
    }
    static long mul(long a,long b,long m)
    {
        long r=1l;
        a%=m;
        while(b>0)
        {
            if((b&1)==1)r=(r*a)%m;
            b>>=1;
            a=(a*a)%m;
        }
        return r;
    }
    static int i()throws IOException
    {
        if(!st.hasMoreTokens())st=new StringTokenizer(br.readLine());
        return Integer.parseInt(st.nextToken());
    }
    static long l()throws IOException
    {
        if(!st.hasMoreTokens())st=new StringTokenizer(br.readLine());
        return Long.parseLong(st.nextToken());
    }
    static String s()throws IOException
    {
        if(!st.hasMoreTokens())st=new StringTokenizer(br.readLine());
        return st.nextToken();
    }
    static double d()throws IOException
    {
        if(!st.hasMoreTokens())st=new StringTokenizer(br.readLine());
        return Double.parseDouble(st.nextToken());
    }
    static void p(Object p){System.out.print(p);}
    static void p(String p){System.out.print(p);}
    static void p(int p){System.out.print(p);}
    static void p(double p){System.out.print(p);}
    static void p(long p){System.out.print(p);}
    static void p(char p){System.out.print(p);}
    static void p(boolean p){System.out.print(p);}
    static void pl(Object p){System.out.println(p);}
    static void pl(String p){System.out.println(p);}
    static void pl(int p){System.out.println(p);}
    static void pl(char p){System.out.println(p);}
    static void pl(double p){System.out.println(p);}
    static void pl(long p){System.out.println(p);}
    static void pl(boolean p){System.out.println(p);}
    static void pl(){System.out.println();}
    static int[] ari(int n)throws IOException
    {
        int ar[]=new int[n];
        if(!st.hasMoreTokens())st=new StringTokenizer(br.readLine());
        for(int x=0;x<n;x++)ar[x]=Integer.parseInt(st.nextToken());
        return ar;
    }
    static int[][] ari(int n,int m)throws IOException
    {
        int ar[][]=new int[n][m];
        for(int x=0;x<n;x++)
        {
            if(!st.hasMoreTokens())st=new StringTokenizer(br.readLine());
            for(int y=0;y<m;y++)ar[x][y]=Integer.parseInt(st.nextToken());
        }
        return ar;
    }
    static long[] arl(int n)throws IOException
    {
        long ar[]=new long[n];
        if(!st.hasMoreTokens())st=new StringTokenizer(br.readLine());
        for(int x=0;x<n;x++) ar[x]=Long.parseLong(st.nextToken());
        return ar;
    }
    static long[][] arl(int n,int m)throws IOException
    {
        long ar[][]=new long[n][m];
        for(int x=0;x<n;x++)
        {
            if(!st.hasMoreTokens())st=new StringTokenizer(br.readLine());
            for(int y=0;y<m;y++)ar[x][y]=Long.parseLong(st.nextToken());
        }
        return ar;
    }
    static String[] ars(int n)throws IOException
    {
        String ar[]=new String[n];
        if(!st.hasMoreTokens())st=new StringTokenizer(br.readLine());
        for(int x=0;x<n;x++) ar[x]=st.nextToken();
        return ar;
    }
    static double[] ard(int n)throws IOException
    {
        double ar[]=new double[n];
        if(!st.hasMoreTokens())st=new StringTokenizer(br.readLine());
        for(int x=0;x<n;x++)ar[x]=Double.parseDouble(st.nextToken());
        return ar;
    }
    static double[][] ard(int n,int m)throws IOException
    {
        double ar[][]=new double[n][m];
        for(int x=0;x<n;x++)
        {
            if(!st.hasMoreTokens())st=new StringTokenizer(br.readLine());
            for(int y=0;y<m;y++)ar[x][y]=Double.parseDouble(st.nextToken());
        }
        return ar;
    }
    static char[] arc(int n)throws IOException
    {
        char ar[]=new char[n];
        if(!st.hasMoreTokens())st=new StringTokenizer(br.readLine());
        for(int x=0;x<n;x++)ar[x]=st.nextToken().charAt(0);
        return ar;
    }
    static char[][] arc(int n,int m)throws IOException
    {
        char ar[][]=new char[n][m];
        for(int x=0;x<n;x++)
        {
            String s=br.readLine();
            for(int y=0;y<m;y++)ar[x][y]=s.charAt(y);
        }
        return ar;
    }
    static void p(int ar[])
    {
        StringBuilder sb=new StringBuilder(2*ar.length);
        for(int a:ar)
        {
            sb.append(a);
            sb.append(' ');
        }
        System.out.println(sb);
    }
    static void p(int ar[][])
    {
        StringBuilder sb=new StringBuilder(2*ar.length*ar[0].length);
        for(int a[]:ar)
        {
            for(int aa:a)
            {
                sb.append(aa);
                sb.append(' ');
            }
            sb.append("\n");
        }
        p(sb);
    }
    static void p(long ar[])
    {
        StringBuilder sb=new StringBuilder(2*ar.length);
        for(long a:ar)
        {
            sb.append(a);
            sb.append(' ');
        }
        System.out.println(sb);
    }
    static void p(long ar[][])
    {
        StringBuilder sb=new StringBuilder(2*ar.length*ar[0].length);
        for(long a[]:ar)
        {
            for(long aa:a)
            {
                sb.append(aa);
                sb.append(' ');
            }
            sb.append("\n");
        }
        p(sb);
    }
    static void p(String ar[])
    {
        int c=0;
        for(String s:ar)c+=s.length()+1;
        StringBuilder sb=new StringBuilder(c);
        for(String a:ar)
        {
            sb.append(a);
            sb.append(' ');
        }
        System.out.println(sb);
    }
    static void p(double ar[])
    {
        StringBuilder sb=new StringBuilder(2*ar.length);
        for(double a:ar)
        {
            sb.append(a);
            sb.append(' ');
        }
        System.out.println(sb);
    }
    static void p(double ar[][])
    {
        StringBuilder sb=new StringBuilder(2*ar.length*ar[0].length);
        for(double a[]:ar)
        {
            for(double aa:a)
            {
                sb.append(aa);
                sb.append(' ');
            }
            sb.append("\n");
        }
        p(sb);
    }
    static void p(char ar[])
    {
        StringBuilder sb=new StringBuilder(2*ar.length);
        for(char aa:ar)
        {
            sb.append(aa);
            sb.append(' ');
        }
        System.out.println(sb);
    }
    static void p(char ar[][])
    {
        StringBuilder sb=new StringBuilder(2*ar.length*ar[0].length);
        for(char a[]:ar)
        {
            for(char aa:a)
            {
                sb.append(aa);
                sb.append(' ');
            }
            sb.append("\n");
        }
        p(sb);
    }
}


//package CodeForces.Round678Div2;

import java.io.*;import java.util.*;import java.math.*;
public class A
{
    static long mod=1000000007l;
    static int max=Integer.MAX_VALUE,min=Integer.MIN_VALUE;
    static long maxl=Long.MAX_VALUE,minl=Long.MIN_VALUE;
    static BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
    static StringTokenizer st;
    static StringBuilder sb;

    static public void main(String[] args)throws Exception
    {
        st=new StringTokenizer(br.readLine());
        int t=i();
        sb=new StringBuilder(1000000);

        while(t-->0) {
            int n = i() ;int m = i() ;
            int[] a = ari(n) ;
            long ans = 0 ;
            for(int i=0;i<n;i++){
                ans+=a[i] ;
            }
            if(ans == m) sl("YES") ;
            else sl("NO");

        }

    }

    static void s(String s){sb.append(s);}
    static void s(int s){sb.append(s);}
    static void s(long s){sb.append(s);}
    static void s(char s){sb.append(s);}
    static void s(double s){sb.append(s);}
    static void ss(){sb.append(' ');}
    static void sl(String s){sb.append(s);sb.append("\n");}
    static void sl(int s){sb.append(s);sb.append("\n");}
    static void sl(long s){sb.append(s);sb.append("\n");}
    static void sl(char s){sb.append(s);sb.append("\n");}
    static void sl(double s){sb.append(s);sb.append("\n");}
    static void sl(){sb.append("\n");}
    static int max(int a,int b){return a>b?a:b;}
    static int min(int a,int b){return a<b?a:b;}
    static int abs(int a){return Math.abs(a);}
    static int floor(int a){return (int)Math.floor(a);}
    static int ceil(int a){return (int)Math.ceil(a);}
    static long max(long a,long b){return a>b?a:b;}
    static long min(long a,long b){return a<b?a:b;}
    static long abs(long a){return Math.abs(a);}
    static int sq(int a){return (int)Math.sqrt(a);}
    static long sq(long a){return (long)Math.sqrt(a);}
    static int gcd(int a,int b){return b==0?a:gcd(b,a%b);}
    static boolean pa(String s,int i,int j)
    {
        while(i<j)if(s.charAt(i++)!=s.charAt(j--))return false;
        return true;
    }
    static int ncr(int n,int c,long m)
    {
        long a=1l;
        for(int x=n-c+1;x<=n;x++)a=((a*x)%m);
        long b=1l;
        for(int x=2;x<=c;x++)b=((b*x)%m);
        return (int)((a*(mul((int)b,m-2,m)%m))%m);
    }
    static boolean[] sieve(int n)
    {
        boolean bo[]=new boolean[n+1];
        bo[0]=true;bo[1]=true;
        for(int x=4;x<=n;x+=2)bo[x]=true;
        for(int x=3;x*x<=n;x+=2)if(!bo[x])for(int y=x*x;y<=n;y+=x)bo[y]=true;
        return bo;
    }
    static long fac(long n){
        if(n==0 || n==1) return 1 ;
        else return 1L*n*fac(n-1) ;
    }
    static long mul(long a,long b,long m)
    {
        long r=1l;
        a%=m;
        while(b>0)
        {
            if((b&1)==1)r=(r*a)%m;
            b>>=1;
            a=(a*a)%m;
        }
        return r;
    }
    static int i()throws IOException
    {
        if(!st.hasMoreTokens())st=new StringTokenizer(br.readLine());
        return Integer.parseInt(st.nextToken());
    }
    static long l()throws IOException
    {
        if(!st.hasMoreTokens())st=new StringTokenizer(br.readLine());
        return Long.parseLong(st.nextToken());
    }
    static String s()throws IOException
    {
        if(!st.hasMoreTokens())st=new StringTokenizer(br.readLine());
        return st.nextToken();
    }
    static double d()throws IOException
    {
        if(!st.hasMoreTokens())st=new StringTokenizer(br.readLine());
        return Double.parseDouble(st.nextToken());
    }
    static void p(Object p){System.out.print(p);}
    static void p(String p){System.out.print(p);}
    static void p(int p){System.out.print(p);}
    static void p(double p){System.out.print(p);}
    static void p(long p){System.out.print(p);}
    static void p(char p){System.out.print(p);}
    static void p(boolean p){System.out.print(p);}
    static void pl(Object p){System.out.println(p);}
    static void pl(String p){System.out.println(p);}
    static void pl(int p){System.out.println(p);}
    static void pl(char p){System.out.println(p);}
    static void pl(double p){System.out.println(p);}
    static void pl(long p){System.out.println(p);}
    static void pl(boolean p){System.out.println(p);}
    static void pl(){System.out.println();}
    static int[] ari(int n)throws IOException
    {
        int ar[]=new int[n];
        if(!st.hasMoreTokens())st=new StringTokenizer(br.readLine());
        for(int x=0;x<n;x++)ar[x]=Integer.parseInt(st.nextToken());
        return ar;
    }
    static int[][] ari(int n,int m)throws IOException
    {
        int ar[][]=new int[n][m];
        for(int x=0;x<n;x++)
        {
            if(!st.hasMoreTokens())st=new StringTokenizer(br.readLine());
            for(int y=0;y<m;y++)ar[x][y]=Integer.parseInt(st.nextToken());
        }
        return ar;
    }
    static long[] arl(int n)throws IOException
    {
        long ar[]=new long[n];
        if(!st.hasMoreTokens())st=new StringTokenizer(br.readLine());
        for(int x=0;x<n;x++) ar[x]=Long.parseLong(st.nextToken());
        return ar;
    }
    static long[][] arl(int n,int m)throws IOException
    {
        long ar[][]=new long[n][m];
        for(int x=0;x<n;x++)
        {
            if(!st.hasMoreTokens())st=new StringTokenizer(br.readLine());
            for(int y=0;y<m;y++)ar[x][y]=Long.parseLong(st.nextToken());
        }
        return ar;
    }
    static String[] ars(int n)throws IOException
    {
        String ar[]=new String[n];
        if(!st.hasMoreTokens())st=new StringTokenizer(br.readLine());
        for(int x=0;x<n;x++) ar[x]=st.nextToken();
        return ar;
    }
    static double[] ard(int n)throws IOException
    {
        double ar[]=new double[n];
        if(!st.hasMoreTokens())st=new StringTokenizer(br.readLine());
        for(int x=0;x<n;x++)ar[x]=Double.parseDouble(st.nextToken());
        return ar;
    }
    static double[][] ard(int n,int m)throws IOException
    {
        double ar[][]=new double[n][m];
        for(int x=0;x<n;x++)
        {
            if(!st.hasMoreTokens())st=new StringTokenizer(br.readLine());
            for(int y=0;y<m;y++)ar[x][y]=Double.parseDouble(st.nextToken());
        }
        return ar;
    }
    static char[] arc(int n)throws IOException
    {
        char ar[]=new char[n];
        if(!st.hasMoreTokens())st=new StringTokenizer(br.readLine());
        for(int x=0;x<n;x++)ar[x]=st.nextToken().charAt(0);
        return ar;
    }
    static char[][] arc(int n,int m)throws IOException
    {
        char ar[][]=new char[n][m];
        for(int x=0;x<n;x++)
        {
            String s=br.readLine();
            for(int y=0;y<m;y++)ar[x][y]=s.charAt(y);
        }
        return ar;
    }
    static void p(int ar[])
    {
        StringBuilder sb=new StringBuilder(2*ar.length);
        for(int a:ar)
        {
            sb.append(a);
            sb.append(' ');
        }
        System.out.println(sb);
    }
    static void p(int ar[][])
    {
        StringBuilder sb=new StringBuilder(2*ar.length*ar[0].length);
        for(int a[]:ar)
        {
            for(int aa:a)
            {
                sb.append(aa);
                sb.append(' ');
            }
            sb.append("\n");
        }
        p(sb);
    }
    static void p(long ar[])
    {
        StringBuilder sb=new StringBuilder(2*ar.length);
        for(long a:ar)
        {
            sb.append(a);
            sb.append(' ');
        }
        System.out.println(sb);
    }
    static void p(long ar[][])
    {
        StringBuilder sb=new StringBuilder(2*ar.length*ar[0].length);
        for(long a[]:ar)
        {
            for(long aa:a)
            {
                sb.append(aa);
                sb.append(' ');
            }
            sb.append("\n");
        }
        p(sb);
    }
    static void p(String ar[])
    {
        int c=0;
        for(String s:ar)c+=s.length()+1;
        StringBuilder sb=new StringBuilder(c);
        for(String a:ar)
        {
            sb.append(a);
            sb.append(' ');
        }
        System.out.println(sb);
    }
    static void p(double ar[])
    {
        StringBuilder sb=new StringBuilder(2*ar.length);
        for(double a:ar)
        {
            sb.append(a);
            sb.append(' ');
        }
        System.out.println(sb);
    }
    static void p(double ar[][])
    {
        StringBuilder sb=new StringBuilder(2*ar.length*ar[0].length);
        for(double a[]:ar)
        {
            for(double aa:a)
            {
                sb.append(aa);
                sb.append(' ');
            }
            sb.append("\n");
        }
        p(sb);
    }
    static void p(char ar[])
    {
        StringBuilder sb=new StringBuilder(2*ar.length);
        for(char aa:ar)
        {
            sb.append(aa);
            sb.append(' ');
        }
        System.out.println(sb);
    }
    static void p(char ar[][])
    {
        StringBuilder sb=new StringBuilder(2*ar.length*ar[0].length);
        for(char a[]:ar)
        {
            for(char aa:a)
            {
                sb.append(aa);
                sb.append(' ');
            }
            sb.append("\n");
        }
        p(sb);
    }
}


import java.io.PrintWriter;
import java.util.*;
import java.lang.*;
public class Main
{
	public static void main(String[] args) {
		PrintWriter out1=new PrintWriter(System.out);
		Scanner sc=new Scanner(System.in);
		int t=sc.nextInt();
        while(t-->0){
            int n=sc.nextInt();
            int m=sc.nextInt();
            long sum=0;
            for(int i=0;i<n;i++){
                sum+=sc.nextInt();
            }
            if(sum<=m){
                out1.print("YES");
            }else{
                out1.print("NO");
            }
        }
        out1.flush();
		out1.close();
	}
}


import java.io.PrintWriter;
import java.util.*;
import java.lang.*;
public class Main
{
	public static void main(String[] args) {
		PrintWriter out1=new PrintWriter(System.out);
		Scanner sc=new Scanner(System.in);
		int t=sc.nextInt();
        while(t-->0){
            int n=sc.nextInt();
            int m=sc.nextInt();
            long sum=0;
            for(int i=0;i<n;i++){
                sum+=sc.nextInt();
            }
            if(sum==m){
                out1.println("YES");
            }else{
                out1.println("NO");
            }
        }
        out1.flush();
		out1.close();
	}
}


import java.io.PrintWriter;
import java.util.*;
import java.lang.*;
public class Main
{
	public static void main(String[] args) {
		PrintWriter out1=new PrintWriter(System.out);
		Scanner sc=new Scanner(System.in);
		int t=sc.nextInt();
        while(t-->0){
            int n=sc.nextInt();
            int m=sc.nextInt();
            long sum=0;
            for(int i=0;i<n;i++){
                sum+=sc.nextInt();
            }
            if(sum<=m){
                out1.println("YES");
            }else{
                out1.println("NO");
            }
        }
        out1.flush();
		out1.close();
	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Scanner;
import java.util.StringTokenizer;

@SuppressWarnings("unused")
public class A {
	public  static  FastScannerA scan = new FastScannerA();
	public static PrintWriter out = new PrintWriter(System.out);

	public static void solve () {
		int t=scan.nextInt();
		while(t-->0) {
			int n=scan.nextInt(),m=scan.nextInt();
			int[]a= scan.readArray(n);
			int sum = 0;
			for(int i=0;i<n;i++) {
				sum+=a[i];
			}
			out.println((sum==m)?"YES":"NO");
		}

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

		solve();
		out.close();
	}

}
class FastScannerA {
	BufferedReader br= new BufferedReader(new InputStreamReader(System.in));
	StringTokenizer st= new StringTokenizer("");
	String next() {
		while (!st.hasMoreTokens())
			try {
				st=new StringTokenizer(br.readLine());
			} catch (IOException e) {
				e.printStackTrace();
			}
		return st.nextToken();
	}
	int nextInt() {
		return Integer.parseInt(next());
	}
	int[] readArray(int n) {
		int[] a=new int[n];
		for (int i=0; i<n; i++) a[i]=nextInt();
		return a;
	}
	long nextLong() {
		return Long.parseLong(next());
	}
	void sort(long[] a) {
		ArrayList<Long> l=new ArrayList<>();
		for (long i:a) l.add(i);
		Collections.sort(l);
		for (int i=0; i<a.length; i++) a[i]=l.get(i);
	}

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Scanner;
import java.util.StringTokenizer;

@SuppressWarnings("unused")
public class A {
	public  static  FastScannerA scan = new FastScannerA();
	public static PrintWriter out = new PrintWriter(System.out);

	public static void solve () {
		int t=scan.nextInt();
		while(t-->0) {
			int n=scan.nextInt(),m=scan.nextInt();
			int[] a= new int[n+1];
			for(int i=1;i<=n;i++)a[i]=scan.nextInt();
			double sum = 0;
			for(int i=1;i<=n;i++) {
				for(int j=i;j<=n;j++) {
					sum=sum+(double)a[j]/j;
				}
			}
			if((sum==(double)m)) System.out.println("YES");
			else {
				sum=0;
				Arrays.sort(a);
				for(int i=1;i<=n;i++) {
					for(int j=i;j<=n;j++) {
						sum=sum+(double)a[j]/j;
					}
				}
				out.println((sum==(double)m)?"YES":"NO");
			}

		}

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

		solve();
		out.close();
	}

}
class FastScannerA {
	BufferedReader br= new BufferedReader(new InputStreamReader(System.in));
	StringTokenizer st= new StringTokenizer("");
	String next() {
		while (!st.hasMoreTokens())
			try {
				st=new StringTokenizer(br.readLine());
			} catch (IOException e) {
				e.printStackTrace();
			}
		return st.nextToken();
	}
	int nextInt() {
		return Integer.parseInt(next());
	}
	int[] readArray(int n) {
		int[] a=new int[n];
		for (int i=0; i<n; i++) a[i]=nextInt();
		return a;
	}
	long nextLong() {
		return Long.parseLong(next());
	}
	void sort(long[] a) {
		ArrayList<Long> l=new ArrayList<>();
		for (long i:a) l.add(i);
		Collections.sort(l);
		for (int i=0; i<a.length; i++) a[i]=l.get(i);
	}

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Scanner;
import java.util.StringTokenizer;

@SuppressWarnings("unused")
public class A {
	public  static  FastScannerA scan = new FastScannerA();
	public static PrintWriter out = new PrintWriter(System.out);

	public static void solve () {
		int t=scan.nextInt();
		while(t-->0) {
			int n=scan.nextInt(),m=scan.nextInt();
			int[] a= new int[n+1];
			for(int i=1;i<=n;i++)a[i]=scan.nextInt();
			double sum = 0;
			Arrays.sort(a);
			for(int i=1;i<=n;i++) {
				for(int j=i;j<=n;j++) {
					sum=sum+(double)a[j]/j;
				}
			}
			out.println((sum==(double)m)?"YES":"NO");
		}

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

		solve();
		out.close();
	}

}
class FastScannerA {
	BufferedReader br= new BufferedReader(new InputStreamReader(System.in));
	StringTokenizer st= new StringTokenizer("");
	String next() {
		while (!st.hasMoreTokens())
			try {
				st=new StringTokenizer(br.readLine());
			} catch (IOException e) {
				e.printStackTrace();
			}
		return st.nextToken();
	}
	int nextInt() {
		return Integer.parseInt(next());
	}
	int[] readArray(int n) {
		int[] a=new int[n];
		for (int i=0; i<n; i++) a[i]=nextInt();
		return a;
	}
	long nextLong() {
		return Long.parseLong(next());
	}
	void sort(long[] a) {
		ArrayList<Long> l=new ArrayList<>();
		for (long i:a) l.add(i);
		Collections.sort(l);
		for (int i=0; i<a.length; i++) a[i]=l.get(i);
	}

}


import java.util.Scanner;

public class Reorder {

    public static void main(String[] args)
    {
        Scanner sc = new Scanner((System.in));
        int tests = sc.nextInt();

        while(tests-- > 0)
        {
            int n = sc.nextInt();
            int m = sc.nextInt();
            int sum = 0;

            for(int i = 0; i < n; i++)
                sum += sc.nextInt();

            System.out.println(sum == m ? "YES" : "NO");
        }

        sc.close();
    }
}


import java.util.*;

public class NewClass {

    public static int fact(int n) {
        if (n == 0) {
            return 1;
        } else {
            return n * fact(n - 1);
        }
    }

    public static ArrayList<Integer> allPossibleArrangementsOfArray(ArrayList<Integer> a1, int[] arr, int n) {
        if (n == arr.length) {
            for (int i = 0; i < arr.length; i++) {
                a1.add(arr[i]);
            }
        }
        for (int i = n; i < arr.length; i++) {
            int temp = arr[n];
            arr[n] = arr[i];
            arr[i] = temp;
            allPossibleArrangementsOfArray(a1, arr, n + 1);
            temp = arr[n];
            arr[n] = arr[i];
            arr[i] = temp;
        }
        return a1;
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int t = in.nextInt();
        for (int q = 0; q < t; q++) {
            int n = in.nextInt();
            int m = in.nextInt();
            int arr[] = new int[n];
            for (int j = 0; j < n; j++) {
                arr[j] = in.nextInt();
            }
            ArrayList<Integer> alist = new ArrayList<Integer>();
            allPossibleArrangementsOfArray(alist, arr, 0);
            int b = 0;
            for (int g = 0; g < fact(n); g++) {
                for (int k = 0; k < n; k++) {
                    arr[k] = alist.get(g * n + k);
                }
                double sum = 0.0;
                for (int i = 1; i <= n; i++) {
                    for (int j = i; j <= n; j++) {
                        sum += (double)((double)arr[j-1] / (double)j );
                    }
                }
                if (sum == m) {
                    b++;
                    break;
            }}
            if (b > 0) {
                System.out.println("YES");
            } else {
                System.out.println("NO");
            }
        }
    }
}


import java.util.*;
public class NewClass {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int t = in.nextInt();
        for (int q = 0; q < t; q++) {
            int n = in.nextInt();
            int m = in.nextInt();
            int arr[] = new int[n];
            int sum=0;
            for (int i = 0; i < n; i++) {
                arr[i]=in.nextInt();
                sum+=arr[i];
            }
            if(sum==m)System.out.println("YES");
            else System.out.println("NO");
        }
    }
}


import java.util.*;

public class NewClass {

    public static int fact(int n) {
        if (n == 0) {
            return 1;
        } else {
            return n * fact(n - 1);
        }
    }

    public static ArrayList<Integer> allPossibleArrangementsOfArray(ArrayList<Integer> a1, int[] arr, int n) {
        if (n == arr.length) {
            for (int i = 0; i < arr.length; i++) {
                a1.add(arr[i]);
            }
        }
        for (int i = n; i < arr.length; i++) {
            int temp = arr[n];
            arr[n] = arr[i];
            arr[i] = temp;
            allPossibleArrangementsOfArray(a1, arr, n + 1);
            temp = arr[n];
            arr[n] = arr[i];
            arr[i] = temp;
        }
        return a1;
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int t = in.nextInt();
        for (int q = 0; q < t; q++) {
            int n = in.nextInt();
            int m = in.nextInt();
            int arr[] = new int[n];
            for (int j = 0; j < n; j++) {
                arr[j] = in.nextInt();
            }
            ArrayList<Integer> alist = new ArrayList<Integer>();
            allPossibleArrangementsOfArray(alist, arr, 0);
            int b = 0;
            for (int g = 0; g < fact(n); g++) {
                for (int k = 0; k < n; k++) {
                    arr[k] = alist.get(g * n + k);
                }
                double sum = 0.0;

                    for (int j = 1; j <= n; j++) {
                        sum += (double)((double)arr[j-1] / (double)j )*j;
                    }

                if (sum == m) {
                    b++;
                    break;
            }}
            if (b > 0) {
                System.out.println("YES");
            } else {
                System.out.println("NO");
            }
        }
    }
}


import java.util.*;

public class NewClass {

    public static int fact(int n) {
        if (n == 0) {
            return 1;
        } else {
            return n * fact(n - 1);
        }
    }

    public static ArrayList<Integer> allPossibleArrangementsOfArray(ArrayList<Integer> a1, int[] arr, int n) {
        if (n == arr.length) {
            for (int i = 0; i < arr.length; i++) {
                a1.add(arr[i]);
            }
        }
        for (int i = n; i < arr.length; i++) {
            int temp = arr[n];
            arr[n] = arr[i];
            arr[i] = temp;
            allPossibleArrangementsOfArray(a1, arr, n + 1);
            temp = arr[n];
            arr[n] = arr[i];
            arr[i] = temp;
        }
        return a1;
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int t = in.nextInt();
        for (int q = 0; q < t; q++) {
            int n = in.nextInt();
            int m = in.nextInt();
            int arr[] = new int[n];
            for (int j = 0; j < n; j++) {
                arr[j] = in.nextInt();
            }
            ArrayList<Integer> alist = new ArrayList<Integer>();
            allPossibleArrangementsOfArray(alist, arr, 0);
            int b = 0;
            for (int g = 0; g < n; g++) {

                    arr[g] = alist.get(g * n + g);

                double sum = 0.0;

                    for (int j = 1; j <= n; j++) {
                        sum += (double)((double)arr[j-1] / (double)j )*j;
                    }

                if (sum == m) {
                    b++;
                    break;
            }}
            if (b > 0) {
                System.out.println("YES");
            } else {
                System.out.println("NO");
            }
        }
    }
}


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

public class Main
{
	public static void main(String[] args) {
		new Thread(null, new Runnable() {
			public void run() {
                solve();
            }
        }, "1", 1 << 26).start();
	}
	static void solve () {
		FastReader fr =new FastReader();	PrintWriter op =new PrintWriter(System.out);

 		int t =fr.nextInt() ,n ,m ;

 		while (t-- > 0) {
 			n =fr.nextInt() ;	m =fr.nextInt() ;

 			while (n-- > 0)
 				m -= fr.nextInt() ;

 			if (m==0)
 				op.println("YES") ;
 			else
 				op.println("NO") ;
 		}
		op.flush();	op.close();
	}
	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();
		}

		String nextLine() {
			String str ="";

			try
			{
				str =br.readLine();
			}
			catch(IOException e)
			{
				e.printStackTrace();
			}

			return str;
		}

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

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


import java.util.*;
import java.lang.*;
import java.io.*;
public class Reorder{
	public static void main(String args[])throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
		int t = Integer.parseInt(br.readLine());
		while(t-->0){
			String str[] = br.readLine().trim().split("\\s+");
			int size = Integer.parseInt(str[0]);
			int sum = Integer.parseInt(str[1]);
			int k=0;
			String arr[] = br.readLine().trim().split("\\s+");
			int totSum=0;
			for(int i=0;i<size;i++){
				int val = Integer.parseInt(arr[i]);
				totSum+=val;
			}
			if(sum==totSum){
				bw.write("YES\n");
			}
			else{
				bw.write("NO\n");
			}
		}
		bw.close();
	}
}


import java.util.*;
public class A {
	static Scanner sc =  new Scanner(System.in);
	public static void main(String[] args) {
	   int t = sc.nextInt();
	   while(t-->0) {
		   int n = sc.nextInt();
		   int m = sc.nextInt();
		   float sum = 0;
		   String ans = null;
		   int arr[] = new int[n];
		   for(int i = 0 ; i < n ; i++)
			   arr[i] = sc.nextInt();
		   for(int i = 1 ; i < n ; i++) {
			   for(int j =  i ; j< n;j++) {
				   sum += (arr[j]/j);

			   }
		   }
		   if(sum == m)
		    	ans = "YES";
		        else
		    	 ans = "NO";
		   System.out.println(ans);
	   }

	}

}


import java.util.*;
public class A {
	static Scanner sc =  new Scanner(System.in);
	public static void main(String[] args) {
	   int t = sc.nextInt();
	   while(t-->0) {

		   int n = sc.nextInt();
		   int m = sc.nextInt();
		   int arr[] = new int[n];
		   int sum = 0;
		   for(int i = 0 ;i <n;i++)
			   arr[i] = sc.nextInt();
		   for(int i = 0 ;i <n;i++)
			   sum+=arr[i];
		   if(sum == m)
			   System.out.println("YES");
		   else
			   System.out.println("NO");
	   }

	}

}


import java.util.*;
public class A {
	static Scanner sc =  new Scanner(System.in);
	public static void main(String[] args) {
	   int t = sc.nextInt();
	   while(t-->0) {
		   int n = sc.nextInt();
		   int m = sc.nextInt();
		   double sum = 0;
		   String ans = null;
		   int arr[] = new int[n];
		   for(int i = 0 ; i < n ; i++)
			   arr[i] = sc.nextInt();
		   Arrays.sort(arr);
		   for(int i = 1 ; i < n ; i++) {
			   for(int j =  1 ; j< n;j++) {

				        sum += arr[j]/j;

				        if(sum == m)
				    	ans = "YES";
				        else
				    	 ans = "NO";
			   }
		   }
		   System.out.println(ans);
	   }

	}

}


import java.util.Scanner;

public class A1436 {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    int noTests = scanner.nextInt();
    for (int testId = 1; testId <= noTests; testId++) {
      int size = scanner.nextInt();
      int sum = 0;
      int maxValue = scanner.nextInt();
      int[] arr = new int[size];
      for (int index = 0; index < size; index++) {
        arr[index] = scanner.nextInt();
        sum += arr[index];
      }
      if (sum == maxValue) {
        System.out.println("YES");
      }
      else {
        System.out.println("NO");
      }
    }
    scanner.close();
  }
}


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

public class A {
	public static void main(String[] arges){
		Scanner in = new Scanner(System.in);
		int T=in.nextInt();
		int i,j,k;
		while(T!=0){
			T--;
			int n,m,res=0;
			n=in.nextInt();
			m=in.nextInt();
			int[] dp=new int[n];
			for(i=0;i<n;i++){
				dp[i]=in.nextInt();
				res+=dp[i];
			}

			if(res==m) System.out.println("YES");
			else System.out.println("NO");
		}
	}
}


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

public class A {
	public static void main(String[] arges){
		Scanner in = new Scanner(System.in);
		int T=in.nextInt();
		int i,j,k;
		while(T!=0){
			T--;
			int n,m;
			n=in.nextInt();
			m=in.nextInt();
			int[] dp=new int[n];
			for(i=0;i<n;i++){
				dp[i]=in.nextInt();
			}
			Arrays.sort(dp);
			double res=0;

			for(i=0;i<n;i++){
				k=i+1;
				for(j=i;j<n;j++){
					res+=((double)(dp[j])/(double)k);
					k++;
				}
			}
			if(res==m) System.out.println("YES");
			else System.out.println("NO");
		}
	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Arrays;
import java.util.InputMismatchException;

public class Div2_1436_0 {
	static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

	public static void main(String[] args) throws NumberFormatException, IOException {
		int t = readInt();

		for(int i=0; i<t; i++) {
			int[] nm = readIntegerArray(2);
			int[] arr = readIntegerArray(nm[0]);

			BigDecimal b = BigDecimal.ZERO;
			BigDecimal m = BigDecimal.valueOf(nm[1]*1.0);

			for(int j=0; j<nm[0]; j++) {
				b = b.add(BigDecimal.valueOf(((1.0*arr[j])/(j+1))*(j+1)));
			}

			System.out.println(b.equals(m) ? "YES" : "NO");

		}
	}

	static int read() throws IOException {
		return br.read();
	}

	static int readInt() throws NumberFormatException, IOException {
		return Integer.parseInt(br.readLine());
	}

	static long readLong() throws NumberFormatException, IOException {
		return Long.parseLong(br.readLine());
	}

	static double readDouble() throws NumberFormatException, IOException {
		return Double.parseDouble(br.readLine());
	}

	static int[] readIntegerArray(int n) throws IOException {
		int[] arr = new int[n];

		String input;

		while ((input = br.readLine()) != null) {

			if (input != null && !input.equals("")) {
				break;
			}
		}

		String[] strArr = input.split(" ");

		for (int i = 0; i < n; i++) {
			arr[i] = Integer.parseInt(strArr[i]);
		}

		return arr;
	}

	static long[] readlongArray(int n) throws IOException {
		long[] arr = new long[n];

		String input;

		while ((input = br.readLine()) != null) {

			if (input != null && !input.equals("")) {
				break;
			}
		}
		String[] strArr = input.split(" ");

		for (int i = 0; i < n; i++) {
			arr[i] = Long.parseLong(strArr[i]);
		}

		return arr;
	}

	static double[] readDoubleArray(int n) throws IOException {
		double[] arr = new double[n];

		String input;

		while ((input = br.readLine()) != null) {

			if (input != null && !input.equals("")) {
				break;
			}
		}
		String[] strArr = input.split(" ");

		for (int i = 0; i < n; i++) {
			arr[i] = Double.parseDouble(strArr[i]);
		}

		return arr;
	}

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


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Arrays;
import java.util.InputMismatchException;

public class Div2_1436_0 {
	static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

	public static void main(String[] args) throws NumberFormatException, IOException {
		int t = readInt();

		for(int i=0; i<t; i++) {
			int[] nm = readIntegerArray(2);
			int[] arr = readIntegerArray(nm[0]);

			long sum=0;
			for(int j=0; j<nm[0]; j++) {
				sum += arr[j];
			}

			System.out.println(sum==nm[1] ? "YES" : "NO");

		}
	}

	static int read() throws IOException {
		return br.read();
	}

	static int readInt() throws NumberFormatException, IOException {
		return Integer.parseInt(br.readLine());
	}

	static long readLong() throws NumberFormatException, IOException {
		return Long.parseLong(br.readLine());
	}

	static double readDouble() throws NumberFormatException, IOException {
		return Double.parseDouble(br.readLine());
	}

	static int[] readIntegerArray(int n) throws IOException {
		int[] arr = new int[n];

		String input;

		while ((input = br.readLine()) != null) {

			if (input != null && !input.equals("")) {
				break;
			}
		}

		String[] strArr = input.split(" ");

		for (int i = 0; i < n; i++) {
			arr[i] = Integer.parseInt(strArr[i]);
		}

		return arr;
	}

	static long[] readlongArray(int n) throws IOException {
		long[] arr = new long[n];

		String input;

		while ((input = br.readLine()) != null) {

			if (input != null && !input.equals("")) {
				break;
			}
		}
		String[] strArr = input.split(" ");

		for (int i = 0; i < n; i++) {
			arr[i] = Long.parseLong(strArr[i]);
		}

		return arr;
	}

	static double[] readDoubleArray(int n) throws IOException {
		double[] arr = new double[n];

		String input;

		while ((input = br.readLine()) != null) {

			if (input != null && !input.equals("")) {
				break;
			}
		}
		String[] strArr = input.split(" ");

		for (int i = 0; i < n; i++) {
			arr[i] = Double.parseDouble(strArr[i]);
		}

		return arr;
	}

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


/* package whatever; // don't place package name! */

import java.util.*;
import java.math.BigInteger;
import java.lang.*;
import java.io.*;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.lang.Math;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;

/* Name of the class has to be "Main" only if the class is public. */
public class bbg
{
	public static int result;

public static ArrayList<Integer> [] graph;

public static int[]cats;
 public static String[]vector;

public static int vizitat[];
public static int x;
//public static HashMap<String, Integer> map2;

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

Scanner input = new Scanner(System.in);

HashMap<Integer, Integer> contor1= new HashMap<Integer, Integer>();
HashMap<Integer, Integer> contor2= new HashMap<Integer, Integer>();

HashMap<Integer, Integer> map= new HashMap<Integer, Integer>();
HashMap<String, Integer> litere= new HashMap<String, Integer>();
HashMap<String, Integer> combinari= new HashMap<String, Integer>();

 //litere.put("a",1);
// litere.put("e",1);
//litere.put("i",1);
//litere.put("o",1);

//litere.put("u",1);
 BigInteger numar_initial;
 BigInteger primul;
 BigInteger doilea;
  BigInteger produs;
  BigInteger unitatea;

   int min,max;
   int contor=0;
   int mutari=0;
  int rez=0;

int teste=input.nextInt();
for (int t=1; t<=teste;t++){

 int n=input.nextInt();
 int m=input.nextInt();
  int vec[]=new int[n];

int suma=0;

for (int i=0; i<n; i++)
{vec[i]=input.nextInt();

 suma+=vec[i];
}

if (suma==m) System.out.println("YES");
else System.out.println("NO");

}

}

}


import java.util.Scanner;

public class ClassA {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int t = sc.nextInt();

		for(int i =0;i<t;i++) {
			int n = sc.nextInt();
			int m = sc.nextInt();
			int sum =0;
			for(int j=0;j<n;j++) {
				sum+= sc.nextInt();
			}

			System.out.println((sum==m)?"YES":"NO");
		}
	}

}


/******************************************************************************

                            Online Java Compiler.
                Code, Compile, Run and Debug java program online.
Write your code in this editor and press "Run" button to execute it.

*******************************************************************************/

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

/* Name of the class has to be "Main" only if the class is public. */
public class Main
{
    public static void main (String[] args) throws java.lang.Exception
    {
        Scanner scan = new Scanner(System.in);
        int T = scan.nextInt();
        while(T-->0){
           int N = scan.nextInt();
		   int M = scan.nextInt();
		   int sum = 0;
		   for(int i=0; i<N; i++){
				sum += scan.nextInt();
           }

		   if(sum == M){
				System.out.println("YES");
		   }else{
				System.out.println("NO");
		   }
        }
    }

}


/******************************************************************************

                            Online Java Compiler.
                Code, Compile, Run and Debug java program online.
Write your code in this editor and press "Run" button to execute it.

*******************************************************************************/

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

/* Name of the class has to be "Main" only if the class is public. */
public class Main
{
    public static void main (String[] args) throws java.lang.Exception
    {
        Scanner scan = new Scanner(System.in);
        int T = scan.nextInt();
        while(T-->0){
           int N = scan.nextInt();
		   int M = scan.nextInt();
		   int sum = 0;
		   for(i=0; i<N; i++){
				sum += scan.nextInt();
           }

		   if(sum == M){
				System.out.println("YES");
		   }else{
				System.out.println("NO");
		   }
        }
    }

}


import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int t = in.nextInt();

        while(t-->0){
            int n = in.nextInt();
            int m = in.nextInt();

            int[] a= new int[n];
            int sum = 0;
            for(int i=0;i<n;i++){ a[i] = in.nextInt(); sum+= a[i];}
            if(sum==m) System.out.println("YES");
            else System.out.println("NO");
        }
    }
}


import java.util.*;
import java.io.*;
import static java.lang.Math.*;
public class A
{
    static InputReader in=new InputReader(System.in);
    static OutputWriter out=new OutputWriter(System.out);
    static StringBuilder sb=new StringBuilder();
    static long MOD = (long)(998244353);
    static int n;
    static int a[];
    static int part[];

    public static void solve(int tar){
        HashMap<Integer, ArrayList<Integer>> map = new HashMap<>();
        for(int i = 0;i < n; i++) {
            ArrayList<Integer> indices = map.getOrDefault(a[i], new ArrayList<Integer>());
            indices.add(i);
            map.put(a[i], indices);
        }

        // prln(map);

        Set<Integer> done = new HashSet<>();

        for(Map.Entry m: map.entrySet()){
            int one = (int)m.getKey();
            int other = tar - one;

            if(done.contains(one)) continue;
            done.add(one);
            done.add(other);

            ArrayList<Integer> idx = (ArrayList<Integer>) m.getValue();

            if(other == one){
                for(int i =0 ;i < idx.size()/2;i++) {
                    int index = idx.get(i);
                    part[index] = 1;
                }
                continue;
            }

            ArrayList<Integer> idx2 = (ArrayList<Integer>) map.get(other);
            for(int x:idx2) part[x] = 1;
        }
        return;
    }

    // Main Class Starts Here
    public static void main(String args[])throws IOException
    {
        // Write your code.
        int t = in();
        while(t-->0) {
            int n =in();
            int m=in();
            int a[] = an(n);
            int sum = 0;
            for(int i =0 ;i < n; i++) sum += a[i];
            if(sum == m) app("YES\n");
            else app("NO\n");
        }
        out.printLine(sb);
        out.close();
    }

    static class Pair{
        int index;
        int value;
        public Pair(int index, int value){
            this.index = index;
            this.value = value;
        }
    }

    public static int lis(int a[]) {
        int n=a.length;
        if(n==0 || n==1)
            return n;
        int dp[] = new int[n];
        for(int i=0;i<n;i++) {
            dp[i] = 1;
            for(int j=0;j<i;j++) {
                if(a[j] < a[i]) {
                    dp[i] = Math.max(dp[i], (dp[j]+1));
                }
            }
        }
        Arrays.sort(dp);
        return dp[n-1];
    }

    public static long rev(long n) {
        if(n<10L)
            return n;
        long rev = 0L;
        while(n != 0L) {
            long a = n % 10L;
            rev = a + rev*10L;
            n /= 10L;
        }
        return rev;
    }

    public static long pow(long a,long b) {
        if(b==0)
            return 1L;
        if(b==1)
            return a % MOD;
        long f = a * a;
        if(f > MOD)
            f %= MOD;
        long val = pow(f, b/2) % MOD;
        if(b % 2 == 0)
            return val;
        else {
            long temp = val * (a % MOD);
            if(temp > MOD)
                temp = temp % MOD;
            return temp;
        }
    }

    public static long lcm(long a,long b) {
        long lcm = (a*b)/gcd(a,b);
        return lcm;
    }

    public static long gcd(long a,long b) {
        if(b==0)
            return a;
        return gcd(b, a%b);
    }

    public static int[] an(int n) {
        int ar[]=new int[n];
        for(int i=0;i<n;i++)
            ar[i]=in();
        return ar;
    }

    public static long[] lan(int n) {
        long ar[]=new long[n];
        for(int i=0;i<n;i++)
            ar[i]=lin();
        return ar;
    }

    public static String atos(Object ar[]) {
        return Arrays.toString(ar);
    }

    public static int in() {
        return in.readInt();
    }

    public static long lin() {
        return in.readLong();
    }

    public static String sn() {
        return in.readString();
    }

    public static void prln(Object o) {
        out.printLine(o);
    }

    public static void prn(Object o) {
        out.print(o);
    }

    public static int getMax(int a[]) {
        int n = a.length;
        int max = a[0];
        for(int i=1; i < n; i++) {
            max = Math.max(max, a[i]);
        }
        return max;
    }

    public static int getMin(int a[]) {
        int n = a.length;
        int min = a[0];
        for(int i=1; i < n; i++) {
            min = Math.min(min, a[i]);
        }
        return min;
    }

    public static void display(int a[]) {
        out.printLine(Arrays.toString(a));
    }

    public static HashMap<Integer,Integer> hm(int a[]){
        HashMap<Integer,Integer> map=new HashMap<>();
        for(int i=0; i < a.length;i++) {
            int keep = (int)map.getOrDefault(a[i],0);
            map.put(a[i],++keep);
        }
        return map;
    }

    public static void app(Object o) {
        sb.append(o);
    }

    public static long calcManhattanDist(int x1,int y1,int x2,int y2) {
        long xa = Math.abs(x1-x2);
        long ya = Math.abs(y1-y2);
        return (xa+ya);
    }

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

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

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

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

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

        public String readString() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(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;
        }

        public String next() {
            return readString();
        }

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

    static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void print(Object...objects) {
            for (int i = 0; i < objects.length; i++) {
                if (i != 0)
                    writer.print(' ');
                writer.print(objects[i]);
            }
        }

        public void printLine(Object...objects) {
            print(objects);
            writer.println();
        }

        public void close() {
            writer.close();
        }
    }
}


import java.util.*;
import java.lang.*;

public class A {

	static Scanner sc;

	public static void solve() {
		int n = sc.nextInt();
		int target = sc.nextInt();
		int[] arr = new int[n];
		for(int i = 0; i < n; i++) {
			arr[i] = sc.nextInt();
		}
		Arrays.sort(arr);
		double ans = 0;
		for(int i = 0; i < n; i++) {
			int div = i+1;
			for(int j = i; j < n; j++) {
//				System.out.print(arr[j] + "/" + (div) + " + ");
				ans += (double) arr[j] / div;
				div++;
			}
//			System.out.println("");
		}

//		System.out.println("ANS: " + ans);
		if(ans == target) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}
	}

	public static void main(String[] args) {
		sc = new Scanner(System.in);
		int n = sc.nextInt();

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

		sc.close();
	}

}


import java.util.*;
import java.lang.*;

public class A {

	static Scanner sc;

	public static void solve() {
		int n = sc.nextInt();
		double target = sc.nextInt();
		int[] arr = new int[n];
		for(int i = 0; i < n; i++) {
			target -= sc.nextInt();
		}

		if(target == 0) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}
	}

	public static void main(String[] args) {
		sc = new Scanner(System.in);
		int n = sc.nextInt();

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

		sc.close();
	}

}


import java.util.*;
import java.lang.*;

public class A {

	static Scanner sc;

	public static void solve() {
		int n = sc.nextInt();
		double target = sc.nextInt();
		int[] arr = new int[n];
		for(int i = 0; i < n; i++) {
			target -= sc.nextInt();
		}

		if(ans == 0) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}
	}

	public static void main(String[] args) {
		sc = new Scanner(System.in);
		int n = sc.nextInt();

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

		sc.close();
	}

}


import java.io.*;
import java.util.*;
import static java.lang.Math.*;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class MarketingScheme {
    public static void main(String[] args) throws IOException {
        // InputStream inputStream = new FileInputStream("input.txt");
        // OutputStream outputStream = new FileOutputStream("output.txt");
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(in.nextInt(), in, out);
        out.close();
    }
    static class TaskA {
        long mod = (long)(998244353l);
        long fact[];
        int depth[];
        int parentTable[][];
        int degree[];
        ArrayList<Integer> leaves;
        int max = Integer.MIN_VALUE;
        int min = Integer.MAX_VALUE;
        int diam = 0;

        public void solve(int testNumber, InputReader in, PrintWriter out) throws IOException {
            while(testNumber-->0){
                int n = in.nextInt();
                int m = in.nextInt();
                int a[] = new int[n];
                for(int i=0;i<n;i++)
                    a[i] = in.nextInt();
                int sum = 0;
                for(int i=0;i<n;i++)
                    sum += a[i];
                if(sum == m)
                    out.println("YES");
                else
                    out.println("NO");
            }
        }

        public int lower(ArrayList<Integer> a , int x){
            if(a.size() == 0)
                return 0;
            if(a.get(a.size()-1) < x)
                return a.size();
            int l = 0;
            int r = a.size()-1;
            while(l<=r){
                int mid = (l+r)>>1;
                if(a.get(mid)>=x && (mid<1 || a.get(mid-1)<x))
                    return mid;
                else if(a.get(mid) < x)
                    l = mid+1;
                else
                    r = mid-1;
            }
            return -1;
        }

        public Node left(Node x){
            if(x == null || x.empty)
                return x;
            Node y = left(x.left);
            x.left = y;
            return y;
        }

        public Node right(Node x){
            if(x == null || x.empty)
                return x;
            Node y = right(x.right);
            x.right = y;
            return y;
        }

        class Node{
            int val;
            Node left;
            Node right;
            boolean empty;
            public Node(int val){
                this.val = val;
                left = null;
                right = null;
                empty = true;
            }
        }

        public Node add(int a[] , int start , int end){
            if(start>end)
                return null;
            int mid = (start+end)>>1;
            Node root = new Node(a[mid]);
            root.left = add(a , start , mid-1);
            root.right = add(a ,mid+1 , end);
            return root;
        }

        public void dfs(ArrayList<ArrayList<int[]>> a , int index , int parent , int val , int visited[]){
            if(index == a.size()-1){
                max = Math.max(max , val);
                return;
            }
            visited[index] = 1;
            for(int i=0;i<a.get(index).size();i++){
                int u = index;
                int v = a.get(index).get(i)[0];
                int speed = a.get(index).get(i)[1];
                if(visited[v] == 1){
                    if(v == a.size()-1){
                        max = Math.max(max , Math.min(speed , val));
                    }
                    continue;
                }
                dfs(a , v , u , Math.min(val , speed) , visited);
            }
        }

        class Pair{
            int u;
            int v;
            int speed;
            public Pair(int u , int v , int speed){
                this.u = u;
                this.v = v;
                this.speed = speed;
            }
        }

        public void add(HashMap<Integer , ArrayList<Integer>> m , int x , int y){
            if(!m.containsKey(x))
                m.put(x , new ArrayList<>());
            ArrayList<Integer> a = m.get(x);
            a.add(y);
        }

        public void dfs(ArrayList<ArrayList<Integer>> a , int index , int parent , int size[]){
            size[index] = 1;
            depth[index] = 1+depth[parent];
            for(int i=0;i<a.get(index).size();i++){
                if(a.get(index).get(i) == parent)
                    continue;
                dfs(a , a.get(index).get(i) , index , size);
                size[index] += size[a.get(index).get(i)];
            }
        }

        public int distance(ArrayList<ArrayList<Integer>> a , int u , int v){
            return depth[u]+depth[v] - 2*depth[lca(a , u , v)];
        }

        public int lca(ArrayList<ArrayList<Integer>> a , int u , int v){
            if(depth[v]<depth[u]){
                int x = u;
                u = v;
                v = x;
            }
            int diff = depth[v] - depth[u];
            for(int i=0;i<parentTable[v].length;i++){
                // checking whether the ith bit is set in the diff variable
                if(((diff>>i)&1) == 1)
                    v = parentTable[v][i];
            }
            if(v == u)
                return v;
            for(int i=parentTable[v].length-1;i>=0;i--){
                if(parentTable[u][i] != parentTable[v][i]){
                    v = parentTable[v][i];
                    u = parentTable[u][i];
                }
            }
            return parentTable[u][0];
        }

        public int[][] multiply(int a[][] , int b[][]){
            int c[][] = new int[a.length][b[0].length];
            for(int i=0;i<a.length;i++){
                for(int j=0;j<b[0].length;j++){
                    for(int k=0;k<b.length;k++)
                        c[i][j] += a[i][k]*b[k][j];
                }
            }
            return c;
        }

        public int[][] multiply(int a[][] , int b[][] , int mod){
            int c[][] = new int[a.length][b[0].length];
            for(int i=0;i<a.length;i++){
                for(int j=0;j<b[0].length;j++){
                    for(int k=0;k<b.length;k++){
                        c[i][j] += a[i][k]*b[k][j];
                        c[i][j]%=mod;
                    }
                }
            }
            return c;
        }

        public int[][] pow(int a[][] , long b){
            int res[][] = new int[a.length][a[0].length];
            for(int i=0;i<a.length;i++)
                res[i][i] = 1;
            while(b>0){
                if((b&1) == 1)
                    res = multiply(res , a , 10);
                a = multiply(a , a , 10);
                b>>=1;
            }
            return res;
        }

        // for the min max problems
        public void build(int lookup[][] , int arr[], int n) {
            for (int i = 0; i < n; i++)
                lookup[i][0] = arr[i];
            for (int j = 1; (1 << j) <= n; j++) {
                for (int i = 0; (i + (1 << j) - 1) < n; i++) {
                    if (lookup[i][j - 1] > lookup[i + (1 << (j - 1))][j - 1])
                        lookup[i][j] = lookup[i][j - 1];
                    else
                        lookup[i][j] = lookup[i + (1 << (j - 1))][j - 1];
                }
            }
        }
        public int query(int lookup[][] , int L, int R) {
            int j = (int)(Math.log(R - L + 1)/Math.log(2));
            if (lookup[L][j] >= lookup[R - (1 << j) + 1][j])
                return lookup[L][j];
            else
                return lookup[R - (1 << j) + 1][j];
        }

        // for printing purposes
        public void print1d(int a[] , PrintWriter out){
            for(int i=0;i<a.length;i++)
                out.print(a[i] + " ");
            out.println();
        }
        public void print1d(long a[] , PrintWriter out){
            for(int i=0;i<a.length;i++)
                out.print(a[i] + " ");
            out.println();
        }
        public void print2d(int a[][] , PrintWriter out){
            for(int i=0;i<a.length;i++){
                for(int j=0;j<a[i].length;j++)
                    out.print(a[i][j] + " ");
                out.println();
            }
            // out.println();
        }
        public void print2d(long a[][] , PrintWriter out){
            for(int i=0;i<a.length;i++){
                for(int j=0;j<a[i].length;j++)
                    out.print(a[i][j] + " ");
                out.println();
            }
            // out.println();
        }

        public void sieve(int a[]){
            a[0] = a[1] = 1;
            int i;
            for(i=2;i*i<=a.length;i++){
                if(a[i] != 0)
                    continue;
                a[i] = i;
                for(int k = (i)*(i);k<a.length;k+=i){
                    if(a[k] != 0)
                        continue;
                    a[k] = i;
                }
            }
        }

        public long nCrPFermet(int n , int r , long p){
            if(r==0)
                return 1l;
            long fact[] = new long[n+1];
            fact[0] = 1;
            for(int i=1;i<=n;i++)
                fact[i] = (i*fact[i-1])%p;
            long modInverseR = pow(fact[r] , p-2 , p);
            long modInverseNR = pow(fact[n-r] , p-2 , p);
            long w = (((fact[n]*modInverseR)%p)*modInverseNR)%p;
            return w;
        }
        public long pow(long a, long b, long m) {
            a %= m;
            long res = 1;
            while (b > 0) {
                long x = b&1;
                if (x == 1)
                    res = res * a % m;
                a = a * a % m;
                b >>= 1;
            }
            return res;
        }
        public long pow(long a, long b) {
            long res = 1;
            while (b > 0) {
                long x = b&1;
                if (x == 1)
                    res = res * a;
                a = a * a;
                b >>= 1;
            }
            return res;
        }
        public void sortedArrayToBST(TreeSet<Integer> a , int start, int end) {
            if (start > end) {
                return;
            }
            int mid = (start + end) / 2;
            a.add(mid);
            sortedArrayToBST(a, start, mid - 1);
            sortedArrayToBST(a, mid + 1, end);
        }
        class Combine{
            int value;
            int delete;
            Combine(int val , int delete){
                this.value = val;
                this.delete = delete;
            }
        }
        class Sort2 implements Comparator<Combine>{
            public int compare(Combine a , Combine b){
                if(a.value > b.value)
                    return 1;
                else if(a.value == b.value && a.delete>b.delete)
                    return 1;
                else if(a.value == b.value && a.delete == b.delete)
                    return 0;
                return -1;
            }
        }
        public int lowerLastBound(ArrayList<Integer> a , int x){
            int l = 0;
            int r = a.size()-1;
            if(a.get(l)>=x)
                return -1;
            if(a.get(r)<x)
                return r;
            int mid = -1;
            while(l<=r){
                mid = (l+r)/2;
                if(a.get(mid) == x && a.get(mid-1)<x)
                    return mid-1;
                else if(a.get(mid)>=x)
                    r = mid-1;
                else if(a.get(mid)<x && a.get(mid+1)>=x)
                    return mid;
                else if(a.get(mid)<x && a.get(mid+1)<x)
                    l = mid+1;
            }
            return mid;
        }
        public int upperFirstBound(ArrayList<Integer> a , int x){
            int l = 0;
            int r = a.size()-1;
            if(a.get(l)>x)
                return l;
            if(a.get(r)<=x)
                return r+1;
            int mid = -1;
            while(l<=r){
                mid = (l+r)/2;
                if(a.get(mid) == x && a.get(mid+1)>x)
                    return mid+1;
                else if(a.get(mid)<=x)
                    l = mid+1;
                else if(a.get(mid)>x && a.get(mid-1)<=x)
                    return mid;
                else if(a.get(mid)>x && a.get(mid-1)>x)
                    r = mid-1;
            }
            return mid;
        }
        public int lowerLastBound(long a[] , long x){
            int l = 0;
            int r = a.length-1;
            if(a[l]>=x)
                return -1;
            if(a[r]<x)
                return r;
            int mid = -1;
            while(l<=r){
                mid = (l+r)/2;
                if(a[mid] == x && a[mid-1]<x)
                    return mid-1;
                else if(a[mid]>=x)
                    r = mid-1;
                else if(a[mid]<x && a[mid+1]>=x)
                    return mid;
                else if(a[mid]<x && a[mid+1]<x)
                    l = mid+1;
            }
            return mid;
        }
        public int upperFirstBound(long a[] , long x){
            int l = 0;
            int r = a.length-1;
            if(a[l]>x)
                return l;
            if(a[r]<=x)
                return r+1;
            int mid = -1;
            while(l<=r){
                mid = (l+r)/2;
                if(a[mid] == x && a[mid+1]>x)
                    return mid+1;
                else if(a[mid]<=x)
                    l = mid+1;
                else if(a[mid]>x && a[mid-1]<=x)
                    return mid;
                else if(a[mid]>x && a[mid-1]>x)
                    r = mid-1;
            }
            return mid;
        }
        public long log(float number , int base){
            return (long) Math.ceil((Math.log(number) / Math.log(base)) + 1e-9);
        }
        public long gcd(long a , long b){
            if(a<b){
                long c = b;
                b = a;
                a = c;
            }
            while(b!=0){
                long c = a;
                a = b;
                b = c%a;
            }
            return a;
        }
        public long[] gcdEx(long p, long q) {
            if (q == 0)
                return new long[] { p, 1, 0 };
            long[] vals = gcdEx(q, p % q);
            long d = vals[0];
            long a = vals[2];
            long b = vals[1] - (p / q) * vals[2];
            // 0->gcd 1->xValue 2->yValue
            return new long[] { d, a, b };
        }
        public void sievePhi(int a[]){
            a[0] = 0;
            a[1] = 1;
            for(int i=2;i<a.length;i++)
                a[i] = i-1;
            for(int i=2;i<a.length;i++)
                for(int j = 2*i;j<a.length;j+=i)
                    a[j] -= a[i];
        }
        public void lcmSum(long a[]){
            int sievePhi[] = new int[(int)1e6 + 1];
            sievePhi(sievePhi);
            a[0] = 0;
            for(int i=1;i<a.length;i++)
                for(int j = i;j<a.length;j+=i)
                    a[j] += (long)i*sievePhi[i];
        }
    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

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

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

    }
}


import java.io.*;
import java.util.*;
public class Reorder {
	public static void main(String args[])
	{
		Scanner sc=new Scanner(System.in);
		int testcases=sc.nextInt();
		while(testcases-->0)
		{
			int n=sc.nextInt();
			double m=sc.nextDouble();
			double sum=0;
			int arr[]=new int[n];
			for(int i=0;i<n;i++)
			{
				arr[i]=sc.nextInt();
				sum+=(arr[i]*(i+1))/(i+1);
			}
			if(sum==m)
				System.out.println("YES");
			else
				System.out.println("NO");

		}
	}
}


import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int t = sc.nextInt();
        while (t > 0) {
            int n = sc.nextInt();
            int m = sc.nextInt();
            int somme = 0;
            for (int i = 0; i < n; i++)
				somme += sc.nextInt();
            System.out.println(somme == m ? "YES" : "NO");
			t--;
        }
    }
}


import java.util.Scanner;

public class Test {

    public static void main(String[] args) {
        Do();
    }
    private static void Do() {
        Scanner sc = new Scanner(System.in);

        try {
            String t0 = sc.nextLine();
            int t = Integer.parseInt(t0);

            for(int i=0; i<t; i++) {

                String line = sc.nextLine();
                String[] nm = line.split(" ");
                int n = Integer.parseInt(nm[0]);
                long m = Long.parseLong(nm[1]);

                line = sc.nextLine();
                String[] arrayA = line.split(" ");

                String response = process(n, m, arrayA);
                System.out.println(response);
            }

        } catch(Exception e) {
            System.out.println("Exception : " + e.toString());
        }
        sc.close();
    }

    private static String process(int n, long m, String[] arrayA) {

        PermutationGenerator0 pg = new PermutationGenerator0(arrayA.length, 0);
        double somme = 0;
        double sommeTotal = 0;

        while (pg.hasMore()) {
            int[] temp =  pg.getNext();

            sommeTotal=0;
            for (int i = 0; i < temp.length; i++) {
                somme =0;
                for (int j = 0; j <= i; j++){
                    somme += Double.parseDouble(arrayA[temp[j]]) / (temp.length - j);
//                    System.out.println("c = " + (arrayA[temp[j]]) + " / " + (temp.length - j));
                }
                sommeTotal += somme;
//                System.out.println("i = " + i + "    sommeTotal = " + sommeTotal);

            }
            if (sommeTotal == m)
                return "YES";

        }
        return "NO";
    }

}

class PermutationGenerator0 {
    private int[] array;
    private int firstNum;
    private boolean firstReady = false;

    public PermutationGenerator0(int n, int firstNum_) {
        if (n < 1) {
            throw new IllegalArgumentException("The n must be min. 1");
        }
        firstNum = firstNum_;
        array = new int[n];
        reset();
    }

    public void reset() {
        for (int i = 0; i < array.length; i++) {
            array[i] = i + firstNum;
        }
        firstReady = false;
    }

    public boolean hasMore() {
        boolean end = firstReady;
        for (int i = 1; i < array.length; i++) {
            end = end && array[i] < array[i-1];
        }
        return !end;
    }

    public int[] getNext() {

        if (!firstReady) {
            firstReady = true;
            return array;
        }

        int temp;
        int j = array.length - 2;
        int k = array.length - 1;

        // Find largest index j with a[j] < a[j+1]

        for (;array[j] > array[j+1]; j--);

        // Find index k such that a[k] is smallest integer
        // greater than a[j] to the right of a[j]

        for (;array[j] > array[k]; k--);

        // Interchange a[j] and a[k]

        temp = array[k];
        array[k] = array[j];
        array[j] = temp;

        // Put tail end of permutation after jth position in increasing order

        int r = array.length - 1;
        int s = j + 1;

        while (r > s) {
            temp = array[s];
            array[s++] = array[r];
            array[r--] = temp;
        }

        return array;
    } // getNext()

}


import java.util.Scanner;

public class Div3CF674 {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
             Scanner s = new Scanner(System.in);
             int t = s.nextInt();
             while(t-->0) {
            	 int n = s.nextInt();
            	 int x = s.nextInt();
            	 int[] arr = new int[n];
            	 for(int i=0; i<n; i++) {
            		 arr[i] = s.nextInt();
            	 }
            	 System.out.println(findFloor(arr,x));
             }
	}

	public static String findFloor(int[] arr, int x) {
		int sum  = 0;
		for(int i=0; i<arr.length; i++) {
			sum += arr[i];
		}
		return sum == x ? "YES" : "NO";
	}

}


import java.util.Scanner;

public class Div3CF674 {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
             Scanner s = new Scanner(System.in);
             int t = s.nextInt();
             while(t-->0) {
            	 int n = s.nextInt();
            	 int x = s.nextInt();
            	 int[] arr = new int[n];
            	 for(int i=0; i<n; i++) {
            		 arr[i] = s.nextInt();
            	 }
            	 System.out.print(findFloor(arr,x));
             }
	}

	public static String findFloor(int[] arr, int x) {
		int sum  = 0;
		for(int i=0; i<arr.length; i++) {
			sum += arr[i];
		}
		return sum == x ? "YES" : "NO";
	}

}


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

public class A {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int t=sc.nextInt();

        while (t-- >0){
            int a=sc.nextInt();
            int b=sc.nextInt();
            int arr[]=new int[a];
            for (int i=0;i<a;i++){
                arr[i]=sc.nextInt();

            }
            Arrays.sort(arr);
            int count=0;
            for (int i=0;i<arr.length;i++){
                for (int j=i;j<arr.length;j++){

                    int res=arr[j]/(j+1);

                    count=count+res;
                }
            }
            if ((count+2)==b){
                System.out.println("YES");
            }else {
                System.out.println("NO");
            }
        }
    }
}


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

public class A {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int t=sc.nextInt();

        while (t-- >0){
            int a=sc.nextInt();
            int b=sc.nextInt();
            int arr[]=new int[a];
            for (int i=0;i<a;i++){
                arr[i]=sc.nextInt();

            }
            Arrays.sort(arr);
            int count=0,res;
            for (int i=0;i<arr.length;i++){
                for (int j=i;j<arr.length;j++){

                    if (arr[j]!=0){
                        count=count+arr[j];
                    }else {
                        count=0;
                    }
//                        res=(arr[j]/(j+1));
//                        count=(count+res);
                    }
                break;

                }
//            System.out.println(count);
            if ((count)==b){
                System.out.println("YES");
            }else {
                System.out.println("NO");
            }
        }
    }
}


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

public class A {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int t=sc.nextInt();

        while (t-- >0){
            int a=sc.nextInt();
            int b=sc.nextInt();
            int arr[]=new int[a];
            for (int i=0;i<a;i++){
                arr[i]=sc.nextInt();

            }
            Arrays.sort(arr);
            int count=2,res;
            for (int i=0;i<arr.length;i++){
                for (int j=i;j<arr.length;j++){

//                    if (arr[j]/2==1){
//                        int x=arr[j];
//                        res=x/(j+1);
//                        count=(count+res)+2;
//                    }else {
                        res=arr[j]/(j+1);
                        count=(count+res);
                    }

                }

            if ((count)==b){
                System.out.println("YES");
            }else {
                System.out.println("NO");
            }
        }
    }
}


import java.io.*;
import java.util.*;
public final class Main {
    public static void main(String args[]) {
      Scanner sc = new Scanner(System.in);
      int t = sc.nextInt();
      while(t--!=0) {
          int n = sc.nextInt(), m = sc.nextInt();
          int a[] = new int[n];
          int sum = 0;
          for(int i = 0;i < n;i++) {
              a[i] = sc.nextInt();
              sum += a[i];
          }
          if(sum == m) {
              System.out.println("YES");
          } else {
              System.out.println("NO");
          }
      }
    }
}


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

public class Solution extends PrintWriter {

    private void solve()  {
        int t = sc.nextInt();
        for(int tc = 1; tc <= t; tc++) {
            int n = sc.nextInt();
            long m = sc.nextInt();
            long sum = 0;
            for(int i = 0; i < n; i++) {
                sum += sc.nextLong();
            }
            if(sum == m) println("YES");
            else println("NO");
        }
    }

//  Solution() throws FileNotFoundException { super(new File("output.txt")); }
//  InputReader sc = new InputReader(new FileInputStream("test_input.txt"));
  Solution() { super(System.out); }
  InputReader sc = new InputReader(System.in);
  static class InputReader {
      InputReader(InputStream in) { this.in = in; } InputStream in;

      private byte[] buf = new byte[16384];
      private int    curChar;
      private int    numChars;

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

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

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

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

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

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

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

    public static void main(String[] $) {
        new Thread(null, new Runnable() {
            public void run() {
                long start = System.nanoTime();
                try {Solution solution = new Solution(); solution.solve(); solution.flush();}
                catch (Exception e) {e.printStackTrace(); System.exit(1);}
                System.err.println((System.nanoTime()-start)/1E9);
            }
        }, "1", 1 << 27).start();

    }

}


import java.util.*;
public class Solution {
    public static void main(String args[]) {
      Scanner sc=new Scanner(System.in);
      int t=sc.nextInt();
      while(t-->0){
          int n=sc.nextInt();
          int m=sc.nextInt();
          int[] arr=new int[n];
          for(int i=0;i<n;i++){
              arr[i]=sc.nextInt();
          }
          int sum=0;
          for(int i=0;i<n;i++){
               int temp=arr[i];
                  sum+=temp;
          }
          System.out.println(sum==m?"YES":"NO");
      }
    }
}


import java.util.*;
public class Solution {
    public static void main(String args[]) {
      Scanner sc=new Scanner(System.in);
      int t=sc.nextInt();
      while(t-->0){
          int n=sc.nextInt();
          int m=sc.nextInt();
          int[] arr=new int[n];
          for(int i=0;i<n;i++){
              arr[i]=sc.nextInt();
          }
          Arrays.sort(arr);
          float sum=0;
          for(int i=0;i<n;i++){
              for(float j=i+1;j<=n;j++){
                  float temp=arr[(int)(j-1)]/j;
                  sum+=temp;
              }
          }
          sum=Math.round(sum);
          System.out.println(sum==m?"YES":"NO");
      }
    }
}


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

public class Code
{
	public static void main (String[] args) throws java.lang.Exception
	{
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		BufferedWriter bw=new BufferedWriter(new OutputStreamWriter(System.out));

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

		for(int i=0;i<t;i++)
		{
		    String[] inp=br.readLine().split(" ");

		    int n=Integer.parseInt(inp[0]);
		    int m=Integer.parseInt(inp[1]);

		    String[] str=br.readLine().split(" ");

		    int a[]=new int[n];

		    for(int j=0;j<n;j++)
		        a[j]=Integer.parseInt(str[j]);

		    Arrays.sort(a);

		    double sum=0;

		    for(int j=0;j<n;j++)
		        for(int k=j;k<n;k++)
		            sum+=(double)a[k]/(k+1);

		    if(sum==m)
		        bw.write("YES"+"\n");
		    else
		        bw.write("NO"+"\n");

		    bw.flush();
		}
	}
}


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

public class Code
{
	public static void main (String[] args) throws java.lang.Exception
	{
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		BufferedWriter bw=new BufferedWriter(new OutputStreamWriter(System.out));

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

		for(int i=0;i<t;i++)
		{
		    String[] inp=br.readLine().split(" ");

		    int n=Integer.parseInt(inp[0]);
		    int m=Integer.parseInt(inp[1]);

		    String[] str=br.readLine().split(" ");

		    int a[]=new int[n];

		    for(int j=0;j<n;j++)
		        a[j]=Integer.parseInt(str[j]);

		    int sum=0;

		    for(int j=0;j<n;j++)
		            sum+=a[j];

		    if(sum==m)
		        bw.write("YES"+"\n");
		    else
		        bw.write("NO"+"\n");

		    bw.flush();
		}
	}
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        AReorder solver = new AReorder();
        int testCount = Integer.parseInt(in.next());
        for (int i = 1; i <= testCount; i++)
            solver.solve(i, in, out);
        out.close();
    }

    static class AReorder {
        public void solve(int testNumber, InputReader in, OutputWriter out) {

            int n = in.readInt(), m = in.readInt();

            int[] arr = in.readIntArray(n);

            int sum = 0;
            for (int e : arr) sum += e;

            out.printLine(sum == m ? "YES" : "NO");
        }

    }

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

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

        public int[] readIntArray(int size) {
            int[] array = new int[size];
            for (int i = 0; i < size; i++) {
                array[i] = readInt();
            }
            return array;
        }

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

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

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

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public String next() {
            return readString();
        }

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

        }

    }

    static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void print(Object... objects) {
            for (int i = 0; i < objects.length; i++) {
                if (i != 0) {
                    writer.print(' ');
                }
                writer.print(objects[i]);
            }
        }

        public void printLine(Object... objects) {
            print(objects);
            writer.println();
        }

        public void close() {
            writer.close();
        }

    }
}