Problem:
Score : 100 points

Problem Statement

Takahashi is participating in a programming contest, AXC001. He has just submitted his code to Problem A.

The problem has N test cases, all of which must be passed to get an AC verdict.

Takahashi's submission has passed M cases out of the N test cases.

Determine whether Takahashi's submission gets an AC.

Constraints

1 \leq N \leq 100

0 \leq M \leq N

All values in input are integers.

Input

Input is given from Standard Input in the following format:

N M

Output

If Takahashi's submission gets an AC, print Yes; otherwise, print No.

Sample Input 1

3 3

Sample Output 1

Yes

All three test cases have been passed, so his submission gets an AC.

Sample Input 2

3 2

Sample Output 2

No

Only two out of the three test cases have been passed, so his submission does not get an AC.

Sample Input 3

1 1

Sample Output 3

Yes

Solution in C++14 (GCC 5.4.1) (judge verdict: Runtime Error)

#include<bits/stdc++.h>
using namespace std;
int N;
int nokori;
/*stack<int> dputed;
stack<int> dfputx;
stack<int> dfputy;ゴミ*/
stack<int> puted;
stack<int> fputx;
stack<int> fputy;
int whatyouhave;
int mustgive = -1;
bool piece[16];
int field[4][4];
int howdeep;
int clist[10][4][2];
bool winflag = false;
stack<int> uselist[4][4];
vector<int> binex(int a){
    vector<int> ret = {0,0,0,0};
    int cnt = 0;
    while(a>0){
        ret[cnt]=a%2;
        a/=2;
        cnt++;
    }
    return ret;
}
bool check(stack<int> cclist){
    while(!cclist.empty()){
        int now = cclist.top();
        int tmp[4] = {0,0,0,0};
        for(int i = 0;i<4;i++){
            if(field[clist[now][i][0]][clist[now][i][1]]==-1){
                for(int j = 0;j<4;j++){
                    tmp[j] = 5;
                }
                break;
            }
            vector<int> tmpp = binex(field[clist[now][i][0]][clist[now][i][1]]);
            for(int j = 0;j<4;j++) tmp[j]+=tmpp[j];
        }
        for(int i = 0;i<4;i++) if(tmp[i]==0 || tmp[i]==4) return true;
        cclist.pop();
    }

    return false;
}
void putpiece(int y,int x,int piecenum){
    fputx.push(x);
    fputy.push(y);
    puted.push(piecenum);
    field[y][x] = piecenum;
    piece[piecenum] = false;
    nokori--;
}
void deletepiece(int y,int x,int piecenum){
    fputx.pop();
    fputy.pop();
    mustgive = puted.top();
    puted.pop();
    field[y][x] = -1;
    piece[piecenum] = true;
    nokori++;
}
bool iswin(int ypiece){
    if(nokori <= howdeep)return false;
    for(int i1 = 0;i1 < 4;i1++){
        for(int i2 = 0;i2 < 4;i2++){
            if(field[i1][i2] == -1){
                putpiece(i1,i2,ypiece);
            }else{
                continue;
            }
            if(check(uselist[i1][i2])){
                return true;
            }
            for(int i3 = 0;i3<16;i3++){
                if(!piece[i3])continue;
                for(int i4 = 0;i4<4;i4++){
                    for(int i5 = 0;i5<4;i5++){
                        if(field[i4][i5] == -1){
                            putpiece(i4,i5,i3);
                        }else{
                            continue;
                        }
                        if(check(uselist[i4][i5])){
                            goto endloop1;
                        }
                        for(int i6 = 0;i6<16;i6++){
                            if(!piece[i6])continue;
                            if(!iswin(i6)){
                                deletepiece(i4,i5,i3);
                                goto endloop1;
                            }else{
                                deletepiece(fputy.top(),fputx.top(),puted.top());
                            }
                        }
                        deletepiece(i4,i5,i3);
                    }
                }
                return true;
                endloop1:;
            }
            deletepiece(i1,i2,ypiece);
        }
    }
    return false;
}
int main(){
    for(int i1 = 0;i1 < 4;i1++){
        for(int i2 = 0;i2 < 4;i2++){
            clist[i1][i2][0] = i1;
            clist[i1][i2][1] = i2;
            uselist[i1][i2].push(i1);
        }
    }
    for(int i1 = 0;i1 < 4;i1++){
         for(int i2 = 0;i2 < 4;i2++){
            clist[i1 + 4][i2][0] = i2;
            clist[i1 + 4][i2][1] = i1;
            uselist[i2][i1].push(i1 + 4);
        }
    }
    for(int i2 = 0;i2 < 4;i2++){
        clist[8][i2][0] = i2;
        clist[8][i2][1] = i2;
        clist[9][i2][0] = i2;
        clist[9][i2][1] = 3 - i2;
        uselist[i2][i2].push(8);
        uselist[i2][3 - i2].push(9);
    }
    int winflag;//今のとこ意味なし
    for(int i1 = 0;i1 < 4;i1++){
        for(int i2 = 0;i2 < 4;i2++){
            field[i1][i2] = -1;
        }
    }
    for(int i1 = 0;i1 < 16;i1++){
        piece[i1] = true;
    }
    cin >> N;
    nokori = 16-N;
    for(int i1 = 0;i1 < N;i1++){
        int tmp1,tmp2,tmp3;
        cin >> tmp1 >> tmp2 >> tmp3;
        field[tmp1][tmp2] = tmp3;
        piece[tmp3] = false;
    }
    cin >> whatyouhave;
    cin >> howdeep;
    
    if(iswin(whatyouhave)){
        cout << "win" << endl;
        while(!fputx.empty()){
            cout << fputy.top() << fputx.top();
            fputy.pop();
            fputx.pop();
        }
        cout << endl;
        cout << mustgive << endl; 
    
    }else{
        cout << "lose" << endl;
    }
    return 0;
}