jiahuimbzuai/CoQuIR huggingface dataset:
//  [typescript]
const stdin = require('fs').readFileSync('/dev/stdin', 'utf8').trim()

const [a, b] = stdin
  .split('\n')[0]
  .split(' ')
  .map(Number)
const s = stdin.split('\n')[1]

const ans = () => {
  const reg = new RegExp(`^\\d{${a}}-\\d{${b}}$`, 'g')

  const isOk = reg.test(s)

  console.log(isOk ? 'Yes' : 'No')
}

ans()
//  [typescript]
const input=require('fs').readFileSync('/dev/stdin','utf8').split(/[\s]/);const tn=():number=>{const a=input[0];input.shift();return Number(a)};const tnn=(n:number):number[]=>{const a=[];for(let i=0;i<n;i++){a.push(tn())}return a};const ts=():string=>{const a=input[0];input.shift();return String(a)};const tss=(n:number):string[]=>{const a=[];for(let i=0;i<n;i++){a.push(ts())}return a};const tc=():string=>{let a=input[0].split('');const b=a[0];a.shift();if(a.length>0){input[0]=a.join('')}else{input.shift()}return String(b)};const tcc=(n:number):string[]=>{const a=[];for(let i=0;i<n;i++){a.push(tc())}return a};const to=(...arg)=>{console.log(...arg)};const abs=(a)=>{return Math.abs(a)};const min=(...a)=>{return Math.min(...a)};const max=(...a)=>{return Math.max(...a)};const floor=(a)=>{return Math.floor(a)};const asc=(ar:number[])=>{return ar.sort((a,b)=>{return a-b})};const desc=(ar:number[])=>{return ar.sort((a,b)=>{return b-a})};const sw=(a,arr:any[],op:'=='|'>='|'>'|'<='|'<'='==')=>{for(let i=0;i<arr.length-1;i+=2){if(eval(a+op+arr[i])){return arr[i+1];}}return arr[arr.length-1]};const near=(n:number,arr:number[]):number=>{let ne=arr[0],ni=0;for(let i=1;i<arr.length;i++){if(Math.abs(n-ne)>Math.abs(n-arr[i])){ne=arr[i];ni=i}}return ni};const objvs =(a)=>{const b=[];for(const v in a){b.push(a[v])}return b};
const main=()=>{
  let [a,b]=tnn(2)
  let s=ts(),ans='Yes'
  for(let i=0;i<a;i++){
    if(!Number.isInteger(Number(s[i])))ans='No'
  }
  if(s[a]!='-')ans='No'
  for(let i=a+1;i<a+b+1;i++){
    if(!Number.isInteger(Number(s[i])))ans='No'
  }
  to(ans)
}
main()
//  [typescript]
import * as fs from 'fs';

namespace AtCoder {
    export interface Paramable {
        args: string[][];
    }

    export interface Task {
        main(this: Task): void;
    }
}

namespace AtCoder.abc084 {
    export class TaskB implements AtCoder.Task, AtCoder.Paramable {
        public constructor(readonly args: string[][]) {
        }

        public main(this: TaskB): void {
            const [a, b]: number[] = this.args[0].map(Number);
            const reg = new RegExp(`^\\d{${a}}-\\d{${b}}$`);
            const result = reg.test(this.args[1][0]);
            const ans: string = result ? 'Yes' : 'No';
            console.log(ans);

        }
    }

    const args: string[][] = fs.readFileSync('/dev/stdin', 'utf8').trim().split('\n').map(r => r.split(' '));
    const task: AtCoder.Task = new TaskB(args);
    task.main();
}
//  [typescript]
import { readFileSync } from "fs";

const read = () =>
  readFileSync(0, "utf8")
    .split("\n")
    .map((line) => line.split(" "));

const main = (input: string[][]) => {
  const [A, B] = input[0].map(Number);
  const S = input[1][0];

  return new RegExp(`^[0-9]{${A}}\-[0-9]{${B}}$`).test(S) ? "Yes" : "No";
};

console.log(main(read()));
//  [python]
ans=0
for i in range(15000000):
  ans+=1
N,K=map(int,input().split());print(1 if N%K else 0)
//  [python]
import numpy as np
import math

N, K = map(int, input().split())

if N % K == 0:
    print(0)
else:
    print(1)
//  [python]
ans=0
for i in range(10000000):
  ans+=1
N,K=map(int,input().split());print(1 if N%K else 0)
//  [java]
import java.util.*;

public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int k = Integer.parseInt(sc.next());
        if(n%k == 0)System.out.println(0);
        else System.out.println(1);
    }
}
//  [java]
import java.util.*;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		if (N % K == 0) {
			System.out.println(0);
		} else {
			System.out.println(1);
		}
	}
}
//  [java]
import java.math.BigDecimal;
import java.math.MathContext;
import java.util.*;

public class Main {


    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        if(scanner.nextInt() % scanner.nextInt() == 0)System.out.println(0);
        else System.out.println(1);

    }





























}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;
 
#define rep(i, n) for (int i = (int)(0); i < (int)(n); ++i)
#define reps(i, n) for (int i = (int)(1); i <= (int)(n); ++i)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rreps(i, n) for (int i = ((int)(n)); i > 0; i--)
#define irep(i, m, n) for (int i = (int)(m); i < (int)(n); ++i)
#define ireps(i, m, n) for (int i = (int)(m); i <= (int)(n); ++i)
#define FOR(e, c) for (auto &e : c)
#define SORT(v, n) sort(v, v + n);
#define vsort(v) sort(v.begin(), v.end());
#define rvisort(v) sort(v.begin(), v.end(), greater<int>());
#define all(v) v.begin(), v.end()
#define mp(n, m) make_pair(n, m);
#define cout(d) cout<<d<<endl;
#define coutd(d) cout<<std::setprecision(10)<<d<<endl;
#define cinline(n) getline(cin,n);
 
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using pii = pair<int, int>;
using vpii = vector<pii>;
using vs = vector<string>;
using vd = vector<double>;
using ul = unsigned long;
 
template<class T, class C> void chmax(T& a, C b){ a>b?:a=b; }
template<class T, class C> void chmin(T& a, C b){ a<b?:a=b; }
 
const int mod=1e9+7;
 
struct mint {
  ll x;
  mint(ll x=0):x(x%mod){}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const {
    mint res(*this);
    return res+=a;
  }
  mint operator-(const mint a) const {
    mint res(*this);
    return res-=a;
  }
  mint operator*(const mint a) const {
    mint res(*this);
    return res*=a;
  }
};
 
mint c[4005][4005];
void init() {
  c[0][0] = 1;
  for (int i = 0; i <= 4000; i++) {
    for (int j = 0; j <= i; j++) {
      c[i+1][j] += c[i][j];
      c[i+1][j+1] += c[i][j];
    }
  }
}
mint comb(int n, int k) {
  return c[n][k];
}
 
bool IsPrime(int num)
{
    if (num < 2) return false;
    else if (num == 2) return true;
    else if (num % 2 == 0) return false;
 
    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            return false;
        }
    }
 
    return true;
}
 
map<ll, ll> primeFact(ll n) {
  map<ll, ll> res;
  for (ll i = 2; i * i <= n; i++) {
    while (n % i == 0) {
      res[i]++;
      n /= i;
    }
  }
  if (n != 1) res[n]++;
  return res;
}
 
void printv(vi& v){
  rep(i,v.size()) cout << v[i] << " ";
  cout << endl;
}
void printv(vll& v){
  rep(i,v.size()) cout << v[i] << " ";
  cout << endl;
}
int vtotal(vi& v){
  int total=0;
  rep(i,v.size()) total+=v[i];
  return total;
}
 
int main()
{
  //init(); // mint初期化
  cin.tie( 0 );
  ios::sync_with_stdio( false );
 
  int n,k;
  cin>>n>>k;
  int ans=1;
  if(n%k==0)ans=0;
  cout(ans);
  return 0;
}
//  [cpp]
#include<iostream>
using namespace std;

int main(){
  int N,K;
  cin >> N >>K ;
  if(N%K==0)cout << "0" << endl;
  if(N%K!=0)cout << "1" << endl;

}
//  [cpp]
#include<bits/stdc++.h>
using namespace std;

typedef long long int ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector< pair<int,int> > vpii;
typedef vector< pair<ll,ll> > vpll;
typedef vector< vector<int> > matrix;

#define SET(Ar,val) memset(Ar,val,sizeof(Ar))
#define rep(i,val,n)  for(int i=val;i<n;i++)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define LMAX LONG_LONG_MAX
#define LMIN LONG_LONG_MIN
#define IMAX INT_MAX
#define IMIN INT_MIN
#define Modulo 1000000007ll

/*--------------------------------------------------------------------------------------------------------------------------------*/

template <class T> T modpower(T a,T b,T MOD)
{
    T ans=1;
    while(b!=0)
    {
        if(b%2==1)
        ans=(ans*a)%MOD;
        a=(a*a)%MOD;
        b/=2;
    }
    return ans;
}

void init()
{
    int n,k;
    cin >> n >> k ;
    if(n%k == 0)
        cout << 0;
    else
        cout << 1;
}

int main()
{
    clock_t time1 = clock();
	
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
    init();
    clock_t time2 = clock();
    cerr <<"Time: " <<(double)(time2-time1)/CLOCKS_PER_SEC * 100000 <<" seconds" <<endl;
	return 0;
    }
//  [c]
#include <stdio.h>

int main(void)
{
        int n,k;
        scanf("%d%d",&n,&k);
        if(n%k==0)printf("0\n");
        else printf("1\n");
        return 0;
}
//  [c]
 #include<stdio.h>
 int main(void)
 {
     int N,K;
     int i=0;

     scanf("%d%d",&N,&K);

     if(N<K) printf("1\n");
     else if(N%K==0) printf("%d\n",N%K);
     else if(N%K<K) printf("1\n");
     return 0;
 }
//  [c]
#include <stdio.h>

int main(void){
  int n,k;
  scanf("%d %d", &n, &k);
  if(n%k==0) printf("0\n");
  else printf("1\n");
  return 0;
}
//  [javascript]
'use strict';

function Main(input) {
  const N = Number(input.split(' ')[0]);
  const K = Number(input.split(' ')[1]);

  if(N % K === 0) {
    console.log(0);
  } else {
    console.log(1);
  }

};

Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());
//  [javascript]
function Main(s){
  s = s.split(" ").map(a=>+a);
  console.log(s[0]%s[1]?1:0);
}

Main(require("fs").readFileSync("/dev/stdin","utf8"));
//  [javascript]
function main(input){
	n = input.split(' ').map(n=>~~n);
	console.log(Math.ceil(n[0]/n[1])-~~(n[0]/n[1]));
}
main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [go]
package main
 
import (
  "fmt"
)
 
func main() {
  var n, k int
  fmt.Scanf("%d %d", &n, &k)

  ans := 1
  if n % k == 0 {
    ans = 0
  }

  fmt.Printf("%d\n", ans)
}
//  [go]
package main

import (
	"fmt"
)

func main() {
	var n, k int
	fmt.Scan(&n, &k)
	if n%k > 0 {
		fmt.Println(1)
	} else {
		fmt.Println(0)
	}
}
//  [go]
package main

import (
	"fmt"
)

func main() {
	var n, k int
	fmt.Scan(&n, &k)

	if n%k == 0 {
		fmt.Println(0)
	} else {
		fmt.Println(1)
	}
}
//  [ruby]
require 'pp'

n, k = gets.chomp!.split(" ").map(&:to_i)

if n % k == 0
    puts 0
else
    puts 1
end
//  [ruby]
n,k = gets.strip.split.map(&:to_i)
if n%k == 0
  puts 0
else
  puts 1
end
//  [ruby]
p gets.split.map(&:to_i).inject(:%)==0?0:1
//  [rust]
use proconio::{input, fastout};
use proconio::marker::{Chars};
use proconio::marker::Usize1;
use std::cmp::*;

macro_rules! debug {
      ($($a:expr),*) => {
          eprintln!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
      }
  }

#[fastout]
fn main() {
    input!{
        n: usize,
        k: usize,
    }

    if n%k==0 {
        println!("0");
    } else {
        println!("1");
    }

}
//  [rust]
#![allow(unused_imports)]
use proconio::{input, fastout};
use proconio::marker::*;

#[fastout]
fn main() {
    input! {
    n: usize,
    k: usize,
    }
    let ans = if n % k != 0 {
        1
    } else {
        0
    };
    println!("{}", ans);
}
//  [typescript]
import { readFileSync } from "fs";

const read = () =>
  readFileSync(0, "utf8")
    .split("\n")
    .map((line) => line.split(" "));

const main = (input: string[][]) => {
  const [N, K] = input[0].map(Number);

  return N % K === 0 ? 0 : 1;
};

console.log(main(read()));
//  [typescript]
import * as fs from 'fs';

namespace AtCoder.abc105 {

    class ProgramA {
        args: string[];

        constructor(args: string[]) {
            this.args = args;
        }

        /**
         * in
         *  7 3
         * out
         *  1
         */
        main(): void {
            const [n, k]: number[] = this.args[0].split(' ').map(x => +x);
            (n % k === 0) ? console.log(0) : console.log(1);
        }
    }

    const args = fs.readFileSync('/dev/stdin', 'utf8').trim().split('\n');
    const prg = new ProgramA(args);
    prg.main();
}
//  [typescript]
const stdin = require('fs').readFileSync('/dev/stdin', 'utf8')

const [n, k] = stdin
  .split('\n')[0]
  .split(' ')
  .map(Number)

console.log(n % k === 0 ? 0 : 1)
//  [python]
print("Yes" if input().startswith("YAKI") else "No")
//  [python]

str = input()
check = str.find("YAKI")
if check == 0:
    print("Yes")
else:
    print("No")
//  [python]
print("Yes" if input()[:4] == "YAKI" else "No")
//  [python]
s = input() + 'XXXXXXXXXXXXXXXX'

if s[:4] == 'YAKI':
    print('Yes')
else:
    print('No')
//  [python]
s=input()
if s[:4]=="YAKI":
    print("Yes")
else:
    print("No")
//  [python]
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import array
from bisect import *
from collections import *
import fractions
import heapq 
from itertools import *
import math
import re
import string

S = input()
if S.startswith('YAKI'):
    print("Yes")
else:
    print("No")
//  [java]
import java.io.*;
import java.util.*;

public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader f = new BufferedReader(new InputStreamReader(System.in));
		String s = f.readLine();
		if(s.startsWith("YAKI")) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}
}
//  [java]
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

class Main {
	public static void main(String[] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		try {
//			String str = br.readLine();
//			//int N = Integer.parseInt(str);
//			//StringBuilder sb = new StringBuilder();
//			String[] s = str.split(" ",0);
//			int N = Integer.parseInt(s[0]);
//			int M = Integer.parseInt(s[1]);
//			int K = Integer.parseInt(s[2]);
//			int re = 0;
//			for(int i = 0;i< N+1;i++) {
//				if(re == 1) break;
//				for(int j = 0;j<M+1;j++) {
//					if(i*M+j*N-2*(i+j-1) == K){
//						System.out.println("Yes");
//						re++;
//						break;
//					}
//					if(i==N-1 && j==M-1){
//						System.out.println("No");
//					}
//				}
//			}
			String str = br.readLine();
			if(str.length()< 4) {
				System.out.println("No");
			}else if(str.substring(0, 4).equals("YAKI")) {
				System.out.println("Yes");
			}else {
				System.out.println("No");
			}
//			System.out.println(sb);
//			long max  = 1000000007;
		}catch (Exception e) {
			System.exit(0);
		}
	}

}
//  [java]

import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.NoSuchElementException;

public class Main {

	public static void main(String[] args) {
		FastScanner sc = new FastScanner();
		PrintWriter out = new PrintWriter(System.out);

		String s = sc.next();

		out.println(s.indexOf("YAKI") == 0 ? "Yes" : "No");
		out.flush();
	}

}

class FastScanner {
	private final InputStream in = System.in;
	private final byte[] buffer = new byte[1024];
	private int ptr = 0;
	private int buflen = 0;

	private boolean hasNextByte() {
		if (ptr < buflen) return true;
		else {
			ptr = 0;
			try {
				buflen = in.read(buffer);
			} catch (IOException e) {
				e.printStackTrace();
			}
			if (buflen <= 0) return false;
		}
		return true;
	}

	private byte readByte() {
		if (hasNextByte()) return buffer[ptr++];
		return -1;
	}

	private boolean isPrintableChar(byte c) {
		return '!' <= c && c <= '~';
	}

	private void skipUnprintable() {
		while (hasNextByte() && !isPrintableChar(buffer[ptr])) {
			ptr++;
		}
	}

	public boolean hasNext() {
		skipUnprintable();
		return hasNextByte();
	}

	public String next() {
		if (!hasNext()) throw new NoSuchElementException();
		StringBuilder sb = new StringBuilder();
		byte b = readByte();
		while (isPrintableChar(b)) {
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}

	public int nextInt() {
		if (!hasNext()) throw new NoSuchElementException();
		int n = 0;
		boolean minus = false;
		byte b = readByte();
		if (b == '-') {
			minus = true;
			b = readByte();
		}
		if (b < '0' || '9' < b) throw new NumberFormatException();
		while (true) {
			if ('0' <= b && b <= '9') {
				n *= 10;
				n += b - '0';
			} else if (b == -1 || !isPrintableChar(b)) {
				return minus ? -n : n;
			} else {
				throw new NumberFormatException();
			}
			b = readByte();
		}
	}

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

	public long nextLong() {
		if (!hasNext()) throw new NoSuchElementException();
		long n = 0;
		boolean minus = false;
		byte b = readByte();
		if (b == '-') {
			minus = true;
			b = readByte();
		}
		if (b < '0' || '9' < b) throw new NumberFormatException();
		while (true) {
			if ('0' <= b && b <= '9') {
				n *= 10;
				n += b - '0';
			} else if (b == -1 || !isPrintableChar(b)) {
				return minus ? -n : n;
			} else {
				throw new NumberFormatException();
			}
			b = readByte();
		}
	}

	public long[] nextLongArray(int n) {
		long[] a = new long[n];
		for (int i = 0; i < n; i++) {
			a[i] = nextInt();
		}
		return a;
	}
}
//  [java]
import java.util.*;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		System.out.println(s.indexOf("YAKI")==0 ? "Yes" : "No");
		
		sc.close();
	}
}
//  [java]
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		System.out.println(sc.next().startsWith("YAKI") ? "Yes" : "No");
	}
}
//  [cpp]
#include <cstdio>

char s[12];

int main(){
  scanf("%s", s);

  if(s[0] == 'Y' && s[1] == 'A' && s[2] == 'K' && s[3] == 'I') puts("Yes");
  else puts("No");
  return 0;
}
//  [cpp]
#include<cstdio>
#include<cstring>
using namespace std;
char s[100];
int main()
{
	scanf("%s",s);
	if (s[0]=='Y'&&s[1]=='A'&&s[2]=='K'&&s[3]=='I')
	  printf("Yes");
	else
	  printf("No");
}
//  [cpp]
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<algorithm>
#include<vector>
#include<queue>
using namespace std;
int main(void){

	char a[100];
	int b;
	int c, d;
	int k;
	int n, m;
	int s, t;
	int x, y, z;

	for (int i = 0; i < 100; i++)a[i] = 0;
	scanf("%s", a);


	if(a[0]=='Y'&&a[1]=='A'&&a[2]=='K'&&a[3]=='I')printf("Yes\n");
	else printf("No\n");

	return 0;
}
//  [cpp]
#include<bits/stdc++.h>				//Written by ThiDaiLoc
using namespace std;				//Team Three Wolves
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef vector<ll> vi;
typedef pair<ll,ll> pll;
typedef pair<ll,pll> triple;

#define fu(i,a,b)   for(ll i=a;i<=b;i++)
#define fd(i,b,a)   for(ll i=b;i>=a;i--)
#define ms(a,x)     memset(a, x, sizeof a)
#define prec(n)     fixed<<setprecision(n)
#define uni(a)      (a).erase(unique(all(a)), (a).end())
#define pb(i)       push_back(i)
#define popb()      pop_back()
#define sc(a)       cin>>a
#define sc2(a,b)    cin>>a>>b
#define pr(a)       cout<<a
#define pr2(a,b)    cout<<a<<" "<<b
#define lowb(a,n,x) lower_bound(a,a+n,x) -a
#define lowb2(a,x)  lower_bound(all(a),x) -a.begin()
#define all(x)      (x).begin(), (x).end()
#define sz(a)       (ll)a.size()
#define le(s)       (ll)s.length()		
#define ast(x,a,b)  assert(x>=a and x<=b)				
#define re          return 	
#define	mp(a,b)     make_pair(a,b)
#define se          second
#define fi          first 
#define debug(x)    cerr << #x << " = " << x << endl
#define INPUT       freopen("locin.txt", "r", stdin)
#define OUTPUT      freopen("locout.txt", "w", stdout)
inline ll isqrt(ll k) {ll r = sqrt(k) + 1; while (r * r > k) r--; return r;}
inline ll icbrt(ll k) {ll r = cbrt(k) + 1; while (r * r * r > k) r--; return r;}
inline ll minize(ll& a,ll b){return a=(a>b?b:a);}
inline ll maxize(ll& a,ll b){return a=(a<b?b:a);}
inline string toString(ll n) {stringstream ss; ss << n;return ss.str();}
double const eps = 1e-6;
ll const Base=1e9+7,oo=1e17,MAXN=1e6;

string s;

ll Solves(){
	
	ll n,k,cnt=0,ans=0,x,y,q,sum=0,v,t,m,odd=-1,four=0,two=0;
	// PROCESSING IN HERE
	sc(s);
	if(le(s)>=4){
		if(s[0]=='Y' and s[1]=='A' and s[2]=='K' and s[3]=='I')cout<<"Yes";
		else cout<<"No"; 
	}
	else{
		cout<<"No";
	}
	
	re 0;
	// Hack it if you can :)
}

int main(){
//	INPUT;
	ll JUDGE_ONLINE = 1;
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
//	ll test;
//	sc(test);
//	fu(T,1,test)
	Solves();
	if (!JUDGE_ONLINE) cout << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";  
		
}
//  [cpp]
#ifdef LOCAL111
	#define _GLIBCXX_DEBUG
#else
	#define NDEBUG
#endif
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
const int INF = 1e9;
using namespace std;
template<typename T, typename U> ostream& operator<< (ostream& os, const pair<T,U>& p) { cout << '(' << p.first << ' ' << p.second << ')'; return os; }

#define endl '\n'
#define ALL(a)  (a).begin(),(a).end()
#define SZ(a) int((a).size())
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n)  FOR(i,0,n)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
#ifdef LOCAL111
	#define DEBUG(x) cout<<#x<<": "<<(x)<<endl
	template<typename T> void dpite(T a, T b){ for(T ite = a; ite != b; ite++) cout << (ite == a ? "" : " ") << *ite; cout << endl;}
#else
	#define DEBUG(x) true
	template<typename T> void dpite(T a, T b){ return; }
#endif
#define F first
#define S second
#define SNP string::npos
#define WRC(hoge) cout << "Case #" << (hoge)+1 << ": "
template<typename T> void pite(T a, T b){ for(T ite = a; ite != b; ite++) cout << (ite == a ? "" : " ") << *ite; cout << endl;}
template<typename T> bool chmax(T& a, T b){if(a < b){a = b; return true;} return false;}
template<typename T> bool chmin(T& a, T b){if(a > b){a = b; return true;} return false;}

typedef long long int LL;
typedef unsigned long long ULL;
typedef pair<int,int> P;

void ios_init(){
	//cout.setf(ios::fixed);
	//cout.precision(12);
#ifdef LOCAL111
	return;
#endif
	ios::sync_with_stdio(false); cin.tie(0);	
}

int main()
{
	ios_init();
	string s;
	while(cin >> s) {
		string yaki = "YAKI";
		if(SZ(s) < 4) {
			cout << "No" << endl;
		} else {
			string ans = "Yes";
			REP(i,4){
				if(yaki[i] != s[i]) {
					ans = "No";
				}
			}
			cout << ans << endl;
		}
	}
	return 0;
}
//  [cpp]
#include <bits/stdc++.h>

using namespace std;

int main(){
	string s;
	getline(cin, s);
	cout << ((s.size() > 3 && s[0] == 'Y' && s[1] == 'A' && s[2] == 'K' && s[3] == 'I') ? "Yes" : "No");
	return 0;
}
//  [c]
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>

#define pai 3.1415926535


int main(void){

	char S[11];
	scanf("%s", S);
	int count = 0;
	char S1[] = "YAKI";
	S[4] = '\0';
	if (strcmp(S, S1) == 0) {
		printf("Yes\n");
	}
	else {
		printf("No\n");
	}



	return 0;


}
//  [c]
#include<stdio.h>
#include<stdlib.h>
#include<math.h>

typedef long long int int64;

#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))
#define ABS(a) ((a)>(0)?(a):-(a))

void run(void){
  char s[11];
  scanf("%s",s);
  char t[]="YAKI";
  int i;
  for(i=0;i<4;i++) if(s[i]!=t[i]) break;
  printf("%s\n",i==4?"Yes":"No");
}

int main(void){
  run();
  return 0;
}
//  [c]
#include <stdio.h>
char s[11];
int main()
{
    scanf("%s", s);
    if(s[0]=='Y'&&s[1]=='A'&&s[2]=='K'&&s[3]=='I') puts("Yes");
    else puts("No");
    return 0;
}
//  [c]
#include <stdio.h>
#include <string.h>

int main(){
  char S[12],T[6]="YAKI";
  int c=1;
  scanf("%s",S);
  int l=strlen(S);
  if(l>=4)
    for(int i=0;i<4;i++){
      if(S[i]!=T[i])
        c=0;
    }
  else c=0;
        
  if(c==1) printf("Yes\n");
  else printf("No\n");
  return 0;
}
//  [c]
#include <stdio.h>
int main(void){
    char s[10];
    scanf("%s",s);
    if(s[0]=='Y'&&s[1]=='A'&&s[2]=='K'&&s[3]=='I'){
        printf("Yes\n");
        return 0;
    }
    else printf("No\n");
    return 0;
}
//  [c]
#include<stdio.h>
#include<string.h>

int main()
{
	char str[10];
	char arr[6];
	while(gets(str)!=NULL)
	{

		strncpy(arr,str,4);
		if(strcmp(arr,"YAKI")==0)
			printf("Yes\n");
		else printf("No\n");
	}
	return 0;
}
//  [javascript]
function Main(input) {
	if(input.substr(0,4)=="YAKI"){
		console.log("Yes")
	}else{
		console.log("No")
	}
}Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());
//  [javascript]
function Main(input) {
	console.log(input.split("\n")[0].indexOf("YAKI")===0?"Yes":"No");
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function Main(input) {
    if(input.match(/^YAKI/)){
        console.log('Yes')
    }else{
        console.log('No')
    }
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function main(input){
    //input = "YAKINIKU";
    input = input +'';
    //console.log(input);


    var str = /^YAKI/;
    if(str.test(input))
        console.log("Yes");
    else
        console.log("No");
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [go]
package main

import "fmt"

func main() {
	var s string
	fmt.Scan(&s)

	if len(s) >= 4 && s[:4] == "YAKI" {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}
//  [go]
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func getScanner(fp *os.File) *bufio.Scanner {
	scanner := bufio.NewScanner(fp)
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, 1000005), 1000005)
	return scanner
}

func getNextString(scanner *bufio.Scanner) string {
	scanner.Scan()
	return scanner.Text()
}

func getNextInt(scanner *bufio.Scanner) int {
	i, _ := strconv.Atoi(getNextString(scanner))
	return i
}

func getNextInt64(scanner *bufio.Scanner) int64 {
	i, _ := strconv.ParseInt(getNextString(scanner), 10, 64)
	return i
}

func getNextUint64(scanner *bufio.Scanner) uint64 {
	i, _ := strconv.ParseUint(getNextString(scanner), 10, 64)
	return i
}

func getNextFloat64(scanner *bufio.Scanner) float64 {
	i, _ := strconv.ParseFloat(getNextString(scanner), 64)
	return i
}

func main() {
	fp := os.Stdin
	wfp := os.Stdout
	cnt := 0

	if os.Getenv("MASPY") == "ますピ" {
		fp, _ = os.Open(os.Getenv("BEET_THE_HARMONY_OF_PERFECT"))
		cnt = 2
	}
	if os.Getenv("MASPYPY") == "ますピッピ" {
		wfp, _ = os.Create(os.Getenv("NGTKANA_IS_GENIUS10"))
	}

	scanner := getScanner(fp)
	writer := bufio.NewWriter(wfp)
	solve(scanner, writer)
	for i := 0; i < cnt; i++ {
		fmt.Fprintln(writer, "-----------------------------------")
		solve(scanner, writer)
	}
	writer.Flush()
}

func solve(scanner *bufio.Scanner, writer *bufio.Writer) {
	s := getNextString(scanner)
	yaki := "YAKI"
	if len(s) < len(yaki) {
		fmt.Fprintln(writer, "No")
		return
	}
	for i := 0; i < len(yaki); i++ {
		if s[i] != yaki[i] {
			fmt.Fprintln(writer, "No")
			return
		}
	}
	fmt.Fprintln(writer, "Yes")
}
//  [go]
package main
 
import (
  "fmt"
)
 
func main() {
  var s string
  fmt.Scanf("%s", &s)
  
  ans := "No"
  if len(s) >= 4 && s[0:4] == "YAKI" {
    ans = "Yes"
  }
  fmt.Printf("%s\n", ans)
}
//  [go]
package main

import (
	"bufio"
	"fmt"
	"os"
)

func main() {
	S := ReadString()
	if len(S) >= 4 && S[:4] == "YAKI" {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

var reader = bufio.NewReader(os.Stdin)

func Scan(a ...interface{}) {
	if _, err := fmt.Fscan(reader, a...); err != nil {
		panic(err)
	}
}
func ReadInt() (i int)       { Scan(&i); return }
func ReadString() (s string) { Scan(&s); return }
func ReadInts(n int) []int {
	v := make([]int, n)
	for i := 0; i < n; i++ {
		Scan(&v[i])
	}
	return v
}
//  [go]
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

func main() {
	sc := newScanner()
	S := sc.next()
	if strings.HasPrefix(S, "YAKI") {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}

}

func min(a, b int) int {
	if a > b {
		return b
	}
	return a
}

func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

type scanner struct {
	r   *bufio.Reader
	buf []byte
	p   int
}

func newScanner() *scanner {
	rdr := bufio.NewReaderSize(os.Stdin, 1000)
	return &scanner{r: rdr}
}
func (s *scanner) next() string {
	s.pre()
	start := s.p
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			break
		}
	}
	result := string(s.buf[start:s.p])
	s.p++
	return result
}
func (s *scanner) nextLine() string {
	s.pre()
	start := s.p
	s.p = len(s.buf)
	return string(s.buf[start:])
}
func (s *scanner) nextInt() int {
	v, _ := strconv.Atoi(s.next())
	return v
}
func (s *scanner) nextIntArray() []int {
	s.pre()
	start := s.p
	result := []int{}
	for ; s.p < len(s.buf)+1; s.p++ {
		if s.p == len(s.buf) || s.buf[s.p] == ' ' {
			v, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 0)
			result = append(result, int(v))
			start = s.p + 1
		}
	}
	return result
}
func (s *scanner) pre() {
	if s.p >= len(s.buf) {
		s.readLine()
		s.p = 0
	}
}
func (s *scanner) readLine() {
	s.buf = make([]byte, 0)
	for {
		l, p, e := s.r.ReadLine()
		if e != nil {
			panic(e)
		}
		s.buf = append(s.buf, l...)
		if !p {
			break
		}
	}
}
//  [ruby]
puts gets[0,4] == "YAKI" ? "Yes" : "No"
//  [ruby]
# frozen_string_literal: true

s = gets.chomp

puts s[0..3] == 'YAKI' ? :Yes : :No
//  [ruby]
puts (gets.chomp[/^YAKI.*$/])? "Yes" : "No"
//  [ruby]
input = $stdin.read.split("\n")

input.each do |line|
    puts (line.start_with? "YAKI") ? "Yes" : "No"
end
//  [ruby]
puts`dd`[/^YAKI/]?:Yes: :No
//  [ruby]
s = gets.chomp
if s.length < 4
  puts "No"
else
  puts s[0..3] == "YAKI" ? "Yes" : "No"
end
//  [rust]
#[allow(unused_imports)]
use std::char::*;
#[allow(unused_imports)]
use std::cmp::*;
#[allow(unused_imports)]
use std::collections::*;

#[allow(unused_macros)]
macro_rules! debug {($($a:expr),*) => {println!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);}}
#[allow(unused_macros)]
macro_rules! input { ( source = $ s : expr , $ ( $ r : tt ) * ) => { let mut iter = $ s . split_whitespace ( ) ; let mut next = || { iter . next ( ) . unwrap ( ) } ; input_inner ! { next , $ ( $ r ) * } } ; ( $ ( $ r : tt ) * ) => { let stdin = std :: io :: stdin ( ) ; let mut bytes = std :: io :: Read :: bytes ( std :: io :: BufReader :: new ( stdin . lock ( ) ) ) ; let mut next = move || -> String { bytes . by_ref ( ) . map ( | r | r . unwrap ( ) as char ) . skip_while ( | c | c . is_whitespace ( ) ) . take_while ( | c |! c . is_whitespace ( ) ) . collect ( ) } ; input_inner ! { next , $ ( $ r ) * } } ; }
#[allow(unused_macros)]
macro_rules! input_inner { ( $ next : expr ) => { } ; ( $ next : expr , ) => { } ; ( $ next : expr , $ var : ident : $ t : tt $ ( $ r : tt ) * ) => { let $ var = read_value ! ( $ next , $ t ) ; input_inner ! { $ next $ ( $ r ) * } } ; }
#[allow(unused_macros)]
macro_rules! read_value { ( $ next : expr , ( $ ( $ t : tt ) ,* ) ) => { ( $ ( read_value ! ( $ next , $ t ) ) ,* ) } ; ( $ next : expr , [ $ t : tt ; $ len : expr ] ) => { ( 0 ..$ len ) . map ( | _ | read_value ! ( $ next , $ t ) ) . collect ::< Vec < _ >> ( ) } ; ( $ next : expr , chars ) => { read_value ! ( $ next , String ) . chars ( ) . collect ::< Vec < char >> ( ) } ; ( $ next : expr , usize1 ) => { read_value ! ( $ next , usize ) - 1 } ; ( $ next : expr , $ t : ty ) => { $ next ( ) . parse ::<$ t > ( ) . expect ( "Parse error" ) } ; }

#[derive(PartialEq, PartialOrd)]
pub struct Total<T>(pub T);
impl<T: PartialEq> Eq for Total<T> {}
impl<T: PartialOrd> Ord for Total<T> { fn cmp(&self, other: &Total<T>) -> std::cmp::Ordering { self.0.partial_cmp(&other.0).unwrap() }}

#[allow(dead_code)]
const MAX:usize = 100006;
#[allow(dead_code)]
const INF_U32:u32 = 1 << 31;
#[allow(dead_code)]
const INF_I32:i32 = 1 << 30;
#[allow(dead_code)]
const INF_U64:u64 = 1 << 63;
#[allow(dead_code)]
const INF_I64:i64 = 1 << 62;


fn main() {
    input!{s:String};
    println!("{}", if s.starts_with("YAKI") {"Yes"} else {"No"});
}
//  [rust]
#![allow(non_snake_case)]
#![allow(unused_variables)]
#![allow(dead_code)]

fn main() {
    let S: String = {
        let mut line: String = String::new();
        std::io::stdin().read_line(&mut line).unwrap();
        line.trim().to_string()
    };

    let ans = if S.starts_with("YAKI") { "Yes" } else { "No" };

    println!("{}", ans);
}
//  [rust]
fn main(){
    let s = std::io::stdin();
    let mut sc = Scanner { stdin: s.lock() };
    let s = sc.chars();
    if s.len()>=4&&s[0]=='Y'&&s[1]=='A'&&s[2]=='K'&&s[3]=='I'{
        println!("Yes" );
    }else{
        println!("No");
    }

}


pub struct Scanner<R> {
    stdin: R,
}

impl<R: std::io::Read> Scanner<R> {
    pub fn read<T: std::str::FromStr>(&mut self) -> T {
        use std::io::Read;
        let buf = self
            .stdin
            .by_ref()
            .bytes()
            .map(|b| b.unwrap())
            .skip_while(|&b| b == b' ' || b == b'\n')
            .take_while(|&b| b != b' ' && b != b'\n')
            .collect::<Vec<_>>();
        unsafe { std::str::from_utf8_unchecked(&buf) }
            .parse()
            .ok()
            .expect("Parse error.")
    }
    pub fn vec<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read()).collect()
    }
    pub fn chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
}
//  [rust]
use proconio::input;

fn main() {
    input! {
        s: String
    };
    let ans = s.starts_with("YAKI");
    println!("{}", if ans { "Yes" } else { "No" });
}
//  [rust]
#![allow(unused_imports)]

use text_io::*;
use proconio::*;
use std::collections::*;
use itertools::Itertools;
use std::process::exit;
use std::cmp::*;
use num::*;
use num::integer::Roots;

fn main() {
    input! {
    a:String,
    }
    let mut a=a.chars().collect_vec();
    let mut b=0;
    for i in 0..4 {
        a.push('0');
        if i==0&&a[i]=='Y'{b+=1}
        if i==1&&a[i]=='A'{b+=1}
        if i==2&&a[i]=='K'{b+=1}
        if i==3&&a[i]=='I'{b+=1}
    }
    println!("{}",if b==4{"Yes"}else{"No"})
}
//  [swift]
print(String((readLine()!+"___").characters.map{$0}[0..<4])=="YAKI" ?"Yes":"No")
//  [swift]
import Foundation
print(readLine()!.hasPrefix("YAKI") ?"Yes":"No")
//  [typescript]
declare function require(x: string): any;

var input = require("fs").readFileSync("/dev/stdin", "utf8");
if (input.substring(0, 4) == "YAKI") console.log("Yes");
else console.log("No");
//  [typescript]
// inputに入力データ全体が入る
function Main(input) {
	// 1行目がinput[0], 2行目がinput[1], …に入る
	input = input.split("\n");
	const s = input[0];
	// 処理
  	console.log(s.startsWith('YAKI') ? 'Yes' : 'No');
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [python]
#5
N,W=map(int,input().split())
A=[[0]]+[[int(x) for x in input().split()] for i in range(N)]
A_w=[]
V=N*10**3

dp=[[float("inf") for i in range(V+1)] for j in range(N+1)]
dp[0][0]=0

for i in range(1,N+1):
    w=A[i][0]
    v=A[i][1]
    for sum_v in range(V+1):
        if sum_v-v>=0:
            dp[i][sum_v]=min(dp[i][sum_v],dp[i-1][sum_v-v]+w)
        dp[i][sum_v]=min(dp[i][sum_v],dp[i-1][sum_v])
Max=0
for i in range(V+1):
    if dp[-1][i]<=W:
        Max=i
print(Max)
//  [python]
N,W = map(int,input().split())
WV = []
for i in range(N):
    WV.append(list(map(int,input().split())))
dp = [[float('inf') for j in range(100001)] for i in range(N)]
dp[0][0] = 0
for i in range(N):
    w,v = WV[i]
    if i == 0:
        dp[i][v] = w
    else:
        for j in range(100001):
            if j-v >= 0:
                dp[i][j] = min(dp[i-1][j-v]+w,dp[i-1][j])
            else:
                dp[i][j] = dp[i-1][j]

ans = 0
for i,e in enumerate(dp[-1]):
    if W >= e:
        ans = i
print(ans)
//  [python]
N,W=map(int,input().split())
lw=[]
lv=[]
for i in range(N):
    w,v=map(int,input().split())
    lw.append(w)
    lv.append(v)
ldp=[[float("inf") for j in range(10**5)] for i in range(N)]
for j in range(10**5):
    if lv[0]>=j+1:
        ldp[0][j]=lw[0]
for i in range(1,N):
    for j in range(10**5):
        ldp[i][j]=min(ldp[i-1][j],ldp[i-1][j+1-lv[i]-1]+lw[i] if j+1-lv[i]>0 else lw[i])
for j in range(10**5-1,-1,-1):
    if ldp[N-1][j]<=W:
        print(j+1)
        break
//  [java]
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;

public class Main {
    private static final int INF = Integer.MAX_VALUE;
    public int knapsack(int n, int w, int[] weights, int[] values, int sum) {
        Long[][] memo = new Long[n][sum + 1];
        for (int i = 0; i <= sum; i++) {
            dfs(weights, values, i, 0, memo);
        }
        int result = 0;
        for (int j = 0; j <= sum; j++) {
            if (memo[0][j] != null && memo[0][j] <= w) {
                result = j;
            }
        }
        return result;
    }
    private long dfs(int[] weights, int[] values, int sum, int i, Long[][] memo) {
        int n = values.length;
        if (sum <= 0) {
            return 0;
        }
        if (i >= n) {
            return INF;
        }
        if (memo[i][sum] != null) {
            return memo[i][sum];
        }
        long take = INF;
        if (sum >= values[i]) {
            take = weights[i] + dfs(weights, values, sum - values[i], i + 1, memo);
        }
        long skip = dfs(weights, values, sum, i + 1, memo);
        long result = Math.min(take, skip);
        return memo[i][sum] = result;
    }

    public static void main(String[] args)  {
        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
            String[] split = br.readLine().split(" ");
            int n = Integer.parseInt(split[0]);
            int w = Integer.parseInt(split[1]);
            int[] weights = new int[n];
            int[] values = new int[n];
            int sum = 0;
            for (int i = 0; i < n; i++) {
                split = br.readLine().split(" ");
                weights[i] = Integer.parseInt(split[0]);
                values[i] = Integer.parseInt(split[1]);
                sum += values[i];
            }
            Main app = new Main();
            long result = app.knapsack(n, w, weights, values, sum);
            System.out.println(result);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
//  [java]
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.InputStreamReader;
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;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Codes solver = new Codes();
        solver.solve(1, in, out);
        out.close();
    }

    static class Codes {
        static int n;
        static int[] weight;
        static int[] value;
        static Long[][] memo;

        public void solve(int testNumber, Scanner sc, PrintWriter pw) {
            n = sc.nextInt();
            int start = sc.nextInt();
            weight = new int[n];
            value = new int[n];
            for (int i = 0; i < n; i++) {
                weight[i] = sc.nextInt();
                value[i] = sc.nextInt();
            }
            memo = new Long[n][(int) 1e5 + 1];
            int ans = 0;
            for (int i = 0; i <= (int) 1e5; i++) {
                long dp = dp(0, i);
                if (dp <= start)
                    ans = i;
            }
            pw.println(ans);
        }

        private long dp(int idx, int cur) {
            if (cur <= 0)
                return 0;
            if (idx == n)
                return (int) 1e15;
            if (memo[idx][cur] != null)
                return memo[idx][cur];
            long take = weight[idx] + dp(idx + 1, cur - value[idx]);
            long leave = dp(idx + 1, cur);
            return memo[idx][cur] = Math.min(take, leave);
        }

    }

    static class Scanner {
        StringTokenizer st;
        BufferedReader br;

        public Scanner(FileReader r) {
            br = new BufferedReader(r);
        }

        public Scanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }

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

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

    }
}
//  [cpp]
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
#define int ll

#define REP(i,n) for(int i=0;i<n;++i)
#define SORT(name) sort(name.begin(), name.end())
#define ZERO(p) memset(p, 0, sizeof(p))
#define MINUS(p) memset(p, -1, sizeof(p))

const ll LLINF = (1LL<<60);
const int INF = (1LL<<30);
const double DINF = std::numeric_limits<double>::infinity();
const int MOD = 1000000007;
#define MAX_N 110
#define MAX_V 100010

ll N, W;
ll item_v[MAX_N];
ll item_w[MAX_N];
ll dp[MAX_N][MAX_V];

signed main()
{
    cin >> N >> W;
    REP(i, N) { cin >> item_w[i] >> item_v[i]; }

    REP(i, N) { REP(j, MAX_V) { dp[i][j] = (j == 0) ? 0 : LLINF; } }

    // 配る DP
    // dp[j][val] : [0,j] まで使って val を作った時の最小の重さ
    ll ans = 0;
    for(ll i = 0; i < N; ++i) {
        for(ll val = 0; val < MAX_V; ++val) {
            if(val == item_v[i]) { dp[i][val] = min(dp[i][val], item_w[i]); }
            for(ll j = 0; j < i; ++j) {
                if (dp[j][val] + item_w[i] <= W) {
                    dp[i][val + item_v[i]] = min(dp[i][val + item_v[i]], dp[j][val] + item_w[i]);
                }
            }
            if(dp[i][val] <= W) { ans = max(ans, val); }
        }
    }

    printf("%lld\n", ans);
    return 0;
}
//  [cpp]
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
#define int ll

#define REP(i,n) for(int i=0;i<n;++i)
#define SORT(name) sort(name.begin(), name.end())
#define ZERO(p) memset(p, 0, sizeof(p))
#define MINUS(p) memset(p, -1, sizeof(p))
#if 1
#  define DBG(fmt, ...) printf(fmt, ##__VA_ARGS__)
#else
#  define DBG(fmt, ...)
#endif

const ll LLINF = (1LL<<60);
const int INF = (1LL<<30);
const double DINF = std::numeric_limits<double>::infinity();
const int MOD = 1000000007;
#define MAX_N 110
#define MAX_V 100010

ll N, W;
vector< pair<ll, ll> > item;
ll dp[MAX_N][MAX_V];

signed main()
{
    cin >> N >> W;
    item.assign(N, make_pair(0, 0));
    REP(i, N) {
        cin >> item[i].first >> item[i].second;
    }

    REP(i, N) {
        REP(j, MAX_V) {
            dp[i][j] = (j == 0) ? 0 : LLINF;
        }
    }

    ll ans = 0;
    // 配る DP
    // dp[j][val] : [0,j] まで使って val を作った時の最小の重さ
    for(ll i = 0; i < N; ++i) {
        for(ll val = 0; val < MAX_V; ++val) {
            ll w = item[i].first;
            ll v = item[i].second;
            if(val == v) { dp[i][val] = min(dp[i][val], w); }
            for(ll j = 0; j < i; ++j) {
                if (dp[j][val] + w <= W) {
                    dp[i][val + v] = min(dp[i][val + v], dp[j][val] + w);
                }
            }
        }
    }
    for(ll i = 0; i < N; ++i) {
        for(ll val = 0; val < MAX_V; ++val) {
            if(dp[i][val] <= W) { ans = max(ans, val); }
        }
    }

    printf("%lld\n", ans);
    return 0;
}
//  [cpp]

 /*          IT IS GOING TO HAPPEN
                    because
                     I AM GOING TO MAKE IT HAPPEN      */
 
#include<bits/stdc++.h>
using namespace std;
 
#define ll long long 
#define V vector<ll int>
#define VPI vector<pair<int,int>>
#define pb push_back  
#define mp make_pair
#define F first
#define S second
#define pii pair<int,int>
#define all(a) a.begin(),a.end()
 
const ll cnst=1e9+7,di=998244353,N=2e5+1;
 
bool IsQuery=false,found=false; 
ll q=1,a[N],ans;
 
int dx[] = {1, -1, 0, 0};
int dy[] = {0, 0, 1, -1};
 
string s,t;

void solve()
{
    ll n,k,val,ans,W;

    cin>>n>>W;

    ll w[n],v[n];

    for(int i=0;i<n;i++)
    cin>>w[i]>>v[i];
    
    map<int,bool> occ;
    map<ll,ll> dp;

    occ[0]=true;

    for(int i=0;i<n;i++)
    {
        for(int j=1e5;j>=0;j--)
        {
            if(occ[j])
            {
                occ[j+v[i]]=true;

                if(dp[j+v[i]]==0)
                    dp[j+v[i]]=dp[j]+w[i];

                else
                dp[j+v[i]]=min(dp[j]+w[i],dp[j+v[i]]);
            }
        }
    }

    for(int i=0;i<=1e5;i++)
    {
        if(occ[i] && dp[i]<=W)
        ans=i;
    }

    cout<<ans;
    
    return;   
}
int main()
{
    ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    
    if(IsQuery)
    cin>>q;
 
    for(int i=0;i<q;i++)
    {
        solve();
        cout<<"\n";
    }
    return 0;
}
//  [c]
#include<stdio.h>

#define min(a,b) ((a)<(b)?(a):(b))
#define INF 2000000000
int main(){
	int n,i,j;
	long w,wv[2][102]={{0}};
	scanf("%d%ld",&n,&w);
	for(i=1;i<=n;i++)scanf("%ld%ld",&wv[0][i],&wv[1][i]);
	long long dp[102][100002]={{0}};
	for(i=0;i<=100000;i++){
		for(j=0;j<=100;j++){
			dp[j][i]=INF;
		}
	}
	dp[0][0]=0;
	for(i=0;i<=100000;i++){
		for(j=0;j<=n;j++){
			if(i>=wv[1][j])dp[j+1][i]=min(dp[j][i],dp[j][i-wv[1][j]]+wv[0][j]);
			else dp[j+1][i]=dp[j][i];
		}
	}
	long long ans=0;
	for(i=0;i<=100000;i++){
		if(dp[n+1][i]<=w){
			ans=i;
		}
	}
	printf("%lld\n",ans);
	return 0;
}
//  [c]
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>

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

int main(void) {
	int n,W,ans;
	long w,v,dp[105][100005];
	scanf("%d%d",&n,&W);
	for (int i=0;i<=n;i++){
	    for (int j=0;j<100005;j++){
	        dp[i][j] = 10000000000;
	    }
	}
	
	scanf("%lld%lld",&w,&v);
	dp[1][v]=w;
	dp[1][0]=0;

	for (int i=2;i<=n;i++){
	    scanf("%lld%lld",&w,&v);
	    for (int j=0;j<=100005;j++){
	        if(j>=v) {
	            dp[i][j] = min(dp[i-1][j-v]+w,dp[i-1][j]);
	        }else {
	            dp[i][j]=dp[i-1][j];
	        }
	    }
	}

    for (int i=100004;i>=0;i--){
        for (int j=0;j<=n;j++){
            if (dp[j][i] <= W) {
                ans = i;
                printf("%d\n",ans);
                return 0;
            }
        }
    }
}
//  [c]
#include <stdarg.h>
#include <stdio.h>

long long max(int len, ...) {
    long long i, _max, num;
    va_list ap;
    va_start(ap, len);

    _max = va_arg(ap, long long);
    for (i = 1; i < len; i++) {
        num = va_arg(ap, long long);
        if (num > _max)
            _max = num;
    }
    va_end(ap);
    return _max;
}
long long min(int len, ...) {
    long long i, _min, num;
    va_list ap;
    va_start(ap, len);

    _min = va_arg(ap, long long);
    for (i = 1; i < len; i++) {
        num = va_arg(ap, long long);
        if (num < _min)
            _min = num;
    }
    va_end(ap);
    return _min;
}

int main(void) {
    int i, j, N, v[110];
    long long MAXW, w[110], dp[110][100010];
    scanf("%d%lld", &N, &MAXW);
    for (i=1;i<=N;i++) {
        scanf("%lld%d", &w[i], &v[i]);
    }

    for (i=0;i<=N;i++) {
        for (j=0;j<=100000;j++) {
            dp[i][j] = 1LL<<60;
        }
    }
    dp[1][v[1]] = w[1];
    for (i=2;i<=N;i++) {
        dp[i][v[i]] = w[i];
        for (j=0;j<=100000;j++) {
            if (j-v[i] >= 0) {
                dp[i][j] = min( 3, dp[i-1][j-v[i]] + w[i], dp[i-1][j], dp[i][j] );
            } else dp[i][j] = min( 2, dp[i-1][j], dp[i][j] );
        }
    }

    for (j=100000;j>0;j--) {
        if (dp[N][j] <= MAXW) {
            printf("%lld\n", j);
            break;
        }
    }
    return 0;
}