Problem:
 Score : 100 points    Problem Statement There is a set A = \{ a_1, a_2, \ldots, a_N \} consisting of N positive integers.
Taro and Jiro will play the following game against each other.  Initially, we have a pile consisting of K stones.
The two players perform the following operation alternately, starting from Taro:   Choose an element x in A , and remove exactly x stones from the pile.   A player loses when he becomes unable to play.
Assuming that both players play optimally, determine the winner.      Constraints  All values in input are integers.  1 \leq N \leq 100  1 \leq K \leq 10^5  1 \leq a_1 < a_2 < \cdots < a_N \leq K         Input Input is given from Standard Input in the following format:  N  K  a_1  a_2  \ldots  a_N       Output If Taro will win, print First ; if Jiro will win, print Second .        Sample Input 1 2 4
2 3      Sample Output 1 First  If Taro removes three stones, Jiro cannot make a move.
Thus, Taro wins.       Sample Input 2 2 5
2 3      Sample Output 2 Second  Whatever Taro does in his operation, Jiro wins, as follows:   If Taro removes two stones, Jiro can remove three stones to make Taro unable to make a move.  If Taro removes three stones, Jiro can remove two stones to make Taro unable to make a move.        Sample Input 3 2 7
2 3      Sample Output 3 First  Taro should remove two stones. Then, whatever Jiro does in his operation, Taro wins, as follows:   If Jiro removes two stones, Taro can remove three stones to make Jiro unable to make a move.  If Jiro removes three stones, Taro can remove two stones to make Jiro unable to make a move.        Sample Input 4 3 20
1 2 3      Sample Output 4 Second       Sample Input 5 3 21
1 2 3      Sample Output 5 First       Sample Input 6 1 100000
1      Sample Output 6 Second

Solution (Python):
from sys import stdin, stdout


def solve():
    n,k = [int(i) for i in stdin.readline().split()]
    A = [int(i) for i in stdin.readline().split()]
    dp = [False for _ in range(k + 1)]
    for i in range(1, k+1):
        for j in range(n):
            if A[j] > i: break
            if not dp[i - A[j]]: 
                dp[i] = True
                break
    return "First" if dp[k] else "Second"
print(solve())

Solution (Python):
n,k=map(int,input().split())
l=list(map(int,input().split()))
l1=[0]*(k+1)
l1[0]=2
for i in l:
    l1[i]=1
for i in range(1,k+1):
    if l1[i]==0:
        for j in l:
            if l1[i-j]==2 and i-j>=0:
                l1[i]=1
                break
            else:
                l1[i]=2
if l1[k]==1:
    print("First")
else:
    print("Second")

Solution (Python):
def main():
    n, k = map(int, input().split())
    a = tuple(map(int, input().split()))

    dp = [0] * (k + 1)  
    for i1 in range(1, k + 1):  
        for i2 in range(n):
            if i1 - a[i2] >= 0:  
                if dp[i1 - a[i2]] == 0:  
                    dp[i1] = 1
    if dp[k] == 1:
        print('First')
    else:
        print('Second')


if __name__ == '__main__':
    main()

Solution (Python):
n,k=map(int,input().split())
a=list(map(int,input().split()))

dp=[False]*(k+1)
for i in range(0,k+1):
    for j in a:
        if i>=j and  dp[i-j]==False:
            dp[i]=True 
            

print ("First" if dp[k] else "Second")

Solution (Python):
import sys

input_methods=['clipboard','file','key']
using_method=0
input_method=input_methods[using_method]

IN=lambda : map(int, input().split())
LIN=lambda : list(IN())
mod=1000000007



def main():
	
	n , k = IN()
	al = LIN()
	
	rr = ['0']*(k+1)
	
	for i in range(k+1):
		if i < al[0]:
			rr[i]='l'
		
		for v in al:
			if v > i:
				pass
			if rr[i-v] == 'l':
				rr[i]='w'
				break
		else:
			rr[i]='l'
	ret = 'First' if rr[-1] == 'w' else 'Second'
	print(ret)
	
	

isTest=False

def pa(v):
	if isTest:
		print(v)
		
def input_clipboard():
	import clipboard
	input_text=clipboard.get()
	input_l=input_text.splitlines()
	for l in input_l:
		yield l

if __name__ == "__main__":
	if sys.platform =='ios':
		if input_method==input_methods[0]:
			ic=input_clipboard()
			input = lambda : ic.__next__()
		elif input_method==input_methods[1]:
			sys.stdin=open('inputFile.txt')
		else:
			pass
		isTest=True
	else:
		pass
		
			
	ret = main()
	if ret is not None:
		print(ret)

Solution (Python):


def main():
    n, K = map(int, input().split())
    a = list(map(int, input().split()))

    
    dp = [False]*(K+1)
    for k in range(1, K+1):
        for i in a:
            if k >= i and not dp[k-i]:
                dp[k] = True
    print(['Second', 'First'][dp[K]])


if __name__ == "__main__":
    main()

Solution (Python):
n, k = map(int, input().split())
a = list(map(int, input().split()))

dp = [0] * (k + 1)  

for i in range(k + 1):
    list = [j for j in a if i >= j]
    if any(dp[i - j] == -1  for j in list):
        dp[i] = 1
    else:
        dp[i] = -1
print('First' if dp[k] == 1 else 'Second')

Solution (Python):
n, k = map(int, input().split())
a = list(map(int, input().split()))

dp = [0] * (k + 1)  

for i in range(k + 1):
    if any(dp[i - j] == -1 if i >= j else False for j in a):
        dp[i] = 1
    else:
        dp[i] = -1
print('First' if dp[k] == 1 else 'Second')

Solution (Python):
n,k=map(int,input().split())
l=[int(x) for x in input().split()]
dp=[False]*(k+1)
for i in range(k+1):
	for j in range(n):
		if i>=l[j] and not dp[i-l[j]]:
			dp[i]=True
if dp[k]:
	print('First')
else:
	print('Second')

Solution (Python):
N, K = map(int, input().split())
A = [int(i) for i in input().split()]
dp = [False] * (K + 1)

for i in range(1, K + 1):
    for a in A:
        if i >= a:
            dp[i] |= dp[i - a] ^ True
print('First' if dp[K] else 'Second')

Solution (Python):
def main():
    n,k=map(int,input().split())
    a=list(map(int,input().split()))
    dp=[False]*(k+1)
    for j in range(1,k+1):
      for i in a:
        if 0<=j-i and dp[j-i]==False:
          dp[j]=True
    if dp[k]:
      print('First')
    else:
      print('Second')
main()

Solution (Python):
import sys
sys.setrecursionlimit(2147483647)
INF = float("inf")
MOD = 10**9 + 7 
input = lambda:sys.stdin.readline().rstrip()
def resolve():
    n, k = map(int, input().split())
    A = list(map(int, input().split()))
    dp = [False] * (k + 1)

    for i in range(k + 1):
        if dp[i]:
            continue
        for a in A:
            if i + a <= k:
                dp[i + a] = True

    print("First" if dp[k] else "Second")
resolve()

Solution (Python):
N,K=map(int,input().split())
A=sorted(map(int,input().split()))
d=[0]*(K+1)
for i in range(K):
    x=d[i]^1
    if x:
        for a in A:
            if i+a<K+1:
                d[i+a]=x
print(['Second','First'][d[-1]])

Solution (Python):
N, K = map(int, input().split())
A = list(map(int, input().split()))
sorted(A)
DP = [-1] * (K+1)
for i in range(K+1):
    if i < A[0]:
        DP[i] = False
    else:
        for j in A:
            if i - j <= 0:
                DP[i] = False
            if not DP[i-j]:
                DP[i] = True
                break
            DP[i] = False
if DP[K]:
    print('First')
else:
    print('Second')

Solution (Python):
n , k = map(int, input().split())
a = list(map(int, input().split()))


dp = [False]*(k+1)

for i in range(1,k+1):
  for j in range(n):
    if i-a[j]<0:
      break
    if dp[i-a[j]]==False:
      dp[i]=True
      break
if dp[k]==True:
  print("First")
else:
  print("Second")

Solution (Python):
n,k = map(int,input().split())
a = list(map(int,input().split()))
dp = [False]*(k+1)

for i in range(0,k+1):
  for j in range(n):
    if i-a[j] < 0:
      break
    if dp[i-a[j]] == False:
      dp[i] = True
      break
print(["Second","First"][dp[k]])

Solution (Python):
import sys
LI = lambda : [int(x) for x in sys.stdin.readline().split()]
N,K = LI()
a = LI()
dp = [0 for _ in range(K+1)]

for i in range(K,-1,-1):
    if dp[i]: continue
    for x in a:
        if i-x >= 0: dp[i-x] = 1
if dp[0] == 1:
    print('First')
else:
    print('Second')

Solution (Python):
import sys,queue,math,copy,itertools,bisect,collections,heapq
sys.setrecursionlimit(10**7)
INF = 10**18
MOD = 10**9 + 7
LI = lambda : [int(x) for x in sys.stdin.readline().split()]
NI = lambda : int(sys.stdin.readline())
N,K = LI()
a = LI()
dp = [0 for _ in range(K+1)]

for i in range(K,-1,-1):
    if dp[i]: continue
    for x in a: dp[i-x] = 1
if dp[0] == 1:
    print('First')
else:
    print('Second')

Solution (Python):
n,k=map(int,input().split())
a=list(map(int,input().split()))
dp=[False]*(2*k+1)
for i in range(k+1):
    for j in a:dp[i+j]|=not dp[i]
if dp[k]:
    print('First')
else:
    print('Second')

Solution (Python):
n,k=map(int,input().split())
a=list(map(int,input().split()))
dp=[False]*(2*k+1)
for i in range(k+1):
    for j in a:dp[i+j]|=not dp[i]
if dp[k]:
    print('First')
else:
    print('Second')

Solution (Python):
N, K = map(int, raw_input().split())
A = map(int, raw_input().split())
dp = [False]
for i in range(1, K+1):
    dp.append(not all(dp[i-x] for x in A if i >= x))
print "First" if dp[K] else "Second"

Solution (Python):
n,k = map(int,input().split())
a = list(map(int,input().split()))
dp = [False]*(k+1)
i = a[0]
for i in range(a[0],k+1):
  for j in range(n):
    if i-a[j] < 0:
      break
    if dp[i-a[j]] == False:
      dp[i] = True
      break
print(["Second","First"][dp[k]])

Solution (Python):
n, k, *a= map(int, open(0).read().split())
dp = [0]*(k+1)
for i in range(k+1):
    dp[i] = not all(dp[i-s] for s in a if i-s>=0)
print(['Second','First'][dp[-1]])

Solution (Python):
n, k = map(int, input().split())
ns = list(map(int, input().split()))
dp = [0] * (k + 1)
for i in range(k + 1):
    dp[i] = not all(dp[i - s] for s in ns if i - s >= 0)
print(['Second', 'First'][dp[-1]])

Solution (Python):
N,K=map(int,input().split())

A=list(map(int,input().split()))

ma=[]
dp=[False]*(K+1)

for i in range(1,K+1):
    if i in A:
        dp[i]=True
    for j in A:
        if i < j:
            continue
        elif not dp[i-j]:
            dp[i] = True


if dp[K]:
    print("First")
else:
    print("Second")

Solution (Python):






"""Module docstring
"""

import functools
import heapq
import itertools
import logging
import math
import random
import string
import sys
from argparse import ArgumentParser
from collections import defaultdict, deque
from copy import deepcopy


def solve_me(values, k):
    dp = [0 for _ in range(k)]
    
    dp[k - 1] = 1
    for _ in range(k // min(values)):
        prev = dp.copy()
        
        dp = [0 for _ in range(k)]
        for a in values:
            LOG.debug((a))
            for i in range(a, k):
                
                
                if prev[i] & 1 == 1:
                    
                    dp[i - a] |= 2
                
                if prev[i] & 2 == 2:
                    
                    dp[i - a] |= 1
        LOG.debug((dp))
        if dp[0] > 0:
            return dp[0] & 2
    assert False, dp
    return None


def solve(values, k):
    
    dp = [False for _ in range(k + 1)]
    for stones in range(k + 1):
        for a in values:
            if stones < a:
                continue
            if not dp[stones - a]:
                dp[stones] = True
        LOG.debug((dp))
    return dp[k]


def do_job():
    "Do the work"
    LOG.debug("Start working")
    
    N, K = list(map(int, input().split()))
    values = list(map(int, input().split()))
    assert len(values) == N
    result = solve(values, K)
    print("First" if result else "Second")


def configure_log():
    "Configure the log output"
    log_formatter = logging.Formatter("L%(lineno)d - " "%(message)s")
    handler = logging.StreamHandler(sys.stdout)
    handler.setFormatter(log_formatter)
    LOG.addHandler(handler)


LOG = None

if not LOG:
    LOG = logging.getLogger("template")
    configure_log()


def main(argv=None):
    "Program wrapper."
    if argv is None:
        argv = sys.argv[1:]
    parser = ArgumentParser()
    parser.add_argument(
        "-v",
        "--verbose",
        dest="verbose",
        action="store_true",
        default=False,
        help="run as verbose mode",
    )
    args = parser.parse_args(argv)
    if args.verbose:
        LOG.setLevel(logging.DEBUG)
    do_job()
    return 0


if __name__ == "__main__":
    import doctest

    doctest.testmod()
    sys.exit(main())


class memoized:
    """Decorator that caches a function's return value each time it is called.
    If called later with the same arguments, the cached value is returned, and
    not re-evaluated.
    """

    def __init__(self, func):
        self.func = func
        self.cache = {}

    def __call__(self, *args):
        try:
            return self.cache[args]
        except KeyError:
            value = self.func(*args)
            self.cache[args] = value
            return value
        except TypeError:
            
            
            return self.func(*args)

    def __repr__(self):
        """Return the function's docstring."""
        return self.func.__doc__

    def __get__(self, obj, objtype):
        """Support instance methods."""
        return functools.partial(self.__call__, obj)

Solution (Python):






"""Module docstring
"""

import functools
import heapq
import itertools
import logging
import math
import random
import string
import sys
from argparse import ArgumentParser
from collections import defaultdict, deque
from copy import deepcopy


def solve_me(values, k):
    dp = [0 for _ in range(k)]
    
    dp[k - 1] = 1
    for _ in range(k // min(values)):
        prev = dp.copy()
        
        dp = [0 for _ in range(k)]
        for a in values:
            LOG.debug((a))
            for i in range(a, k):
                
                
                if prev[i] & 1 == 1:
                    
                    dp[i - a] |= 2
                
                if prev[i] & 2 == 2:
                    
                    dp[i - a] |= 1
        LOG.debug((dp))
        if dp[0] > 0:
            return dp[0] & 2
    assert False, dp
    return None


def solve(values, k):
    
    dp = [False for _ in range(k + 1)]
    for stones in range(k + 1):
        for a in values:
            if stones < a:
                continue
            if not dp[stones - a]:
                dp[stones] = True
        LOG.debug((dp))
    return dp[k]


def do_job():
    "Do the work"
    LOG.debug("Start working")
    
    N, K = list(map(int, input().split()))
    values = list(map(int, input().split()))
    assert len(values) == N
    result = solve(values, K)
    print("First" if result else "Second")


def configure_log():
    "Configure the log output"
    log_formatter = logging.Formatter("L%(lineno)d - " "%(message)s")
    handler = logging.StreamHandler(sys.stdout)
    handler.setFormatter(log_formatter)
    LOG.addHandler(handler)


LOG = None

if not LOG:
    LOG = logging.getLogger("template")
    configure_log()


def main(argv=None):
    "Program wrapper."
    if argv is None:
        argv = sys.argv[1:]
    parser = ArgumentParser()
    parser.add_argument(
        "-v",
        "--verbose",
        dest="verbose",
        action="store_true",
        default=False,
        help="run as verbose mode",
    )
    args = parser.parse_args(argv)
    if args.verbose:
        LOG.setLevel(logging.DEBUG)
    do_job()
    return 0


if __name__ == "__main__":
    import doctest

    doctest.testmod()
    sys.exit(main())


class memoized:
    """Decorator that caches a function's return value each time it is called.
    If called later with the same arguments, the cached value is returned, and
    not re-evaluated.
    """

    def __init__(self, func):
        self.func = func
        self.cache = {}

    def __call__(self, *args):
        try:
            return self.cache[args]
        except KeyError:
            value = self.func(*args)
            self.cache[args] = value
            return value
        except TypeError:
            
            
            return self.func(*args)

    def __repr__(self):
        """Return the function's docstring."""
        return self.func.__doc__

    def __get__(self, obj, objtype):
        """Support instance methods."""
        return functools.partial(self.__call__, obj)

Solution (Python):
n,k = map(int,input().split())
a = list(map(int,input().split()))
s = [False]*(k+1)
for i in range(k+1):
  for aj in a:
    if i - aj >=0:
      if s[i-aj] == False:
        s[i] = True
        break
if s[k]==True:
  print("First")
else:
  print("Second")

Solution (Python):
N, K = map(int, input().split())
a = list(map(int, input().split()))

a.sort()
ans = ['First', 'Second']

dp = [1]*(K+1)

for i in range(K+1):
    if i < a[0]:
        dp[i] = 1
    else:
        flag = False
        for x in a:
            if i-x >= 0 and dp[i-x]:
                dp[i] = 0
                flag = True
                break

print(ans[dp[-1]])

Solution (Python):
from collections import deque
from itertools import product
import sys

sys.setrecursionlimit(100000)
input = sys.stdin.readline


def read():
    N, K = map(int, input().strip().split())
    A = list(map(int, input().strip().split()))
    return N, K, A


def solve(N, K, A):
    
    dp = [False for i in range(K+1)]
    
    for i in range(min(A)):
        dp[i] = False
    for i in range(min(A), K+1):
        for a in A:
            if i - a >= 0:
                dp[i] |= not dp[i - a]
    return 'First' if dp[K] else 'Second'


if __name__ == "__main__":
    inputs = read()
    print("%s" % solve(*inputs))

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 8)
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N, K = map(int, readline().split())
A = list(map(int, input().split()))
A.sort()
amin, amax = A[0], A[-1]


def solve():
    dp = [None] * (K + 1)
    for i in range(amin):
        dp[i] = False
    for i in range(amin, K + 1):
        winnable = False
        for a in A:
            j = i - a
            if j < 0:
                break
            assert dp[j] is not None
            if not dp[j]:
                dp[i] = True
                winnable = True
                break
        if not winnable:
            dp[i] = False
    return dp[K]


if __name__ == "__main__":
    print("First" if solve() else "Second")

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)


n, k, *a = map(int, read().split())
dp = [False] * (k + 1)
for i in range(k + 1):
    for j in range(n):
        if i - a[j] >= 0:
            dp[i] |= not dp[i - a[j]]
if dp[k]:
    print('First')
else:
    print('Second')

Solution (Python):
n,k=map(int,input().split())
a=list(map(int,input().split()))

dp=[0]*(k+1)

for i in range(1,k+1):
    x=1
    for j in range(n):
        if i-a[j]>=0:
            x *= dp[i-a[j]]
    if x==1:
        dp[i]=0
    else:
        dp[i]=1
if dp[k]==1:
    print("First")
else:
    print("Second")

Solution (Python):
n,k=map(int,input().split())
a=list(map(int,input().split()))

dp=[False]*(10**5+1)
dp[0]=False
for aa in a:
  dp[aa]=True

for i in range(1,k+1):
  ok=False
  for j in range(n):
    if i-a[j]>=0:
      if dp[i-a[j]]==0:
        ok=True
  if ok: 
    dp[i]=True

print("First") if dp[k] else print("Second")

Solution (Python):
n, k = map(int, input().split())
a = list(map(int, input().split()))
dp = [None]*(k+1)
ind = 0
while ind<a[0]:
    dp[ind] = False
    ind += 1
for i in range(ind, k+1):
    for j in a:
        if i-j<0:
            dp[i] = False
            break
        if not dp[i-j]:
            dp[i] = True
            break
    else:
        dp[i] = False
print('First' if dp[k] else 'Second')

Solution (Python):
N, K = map(int, input().split())
A = list(map(int, input().split()))

dp = [False] * (K + 1)

for i in range(K + 1):
    for j in range(N):
        if i - A[j] >= 0:
            dp[i] |= not dp[i - A[j]]

if dp[K]:
    print('First')
else:
    print('Second')

Solution (Python):
N, K = map(int, input().split())
A = tuple(map(int, input().split()))

dp = [False] * (K + 1)
for i in range(1, K + 1):
    dp[i] = not all(dp[i - x] for x in A if i - x >= 0)
print('First' if dp[K] else 'Second')

Solution (Python):


def submit():
    n, k = map(int, input().split())
    a = list(map(int, input().split()))
    a.sort()

    dp = [False for _ in range(k + 1)]
    for i in range(k + 1):
        for e in a:
            if i >= e:
                dp[i] = dp[i] or not dp[i - e]
    
    if dp[k]:
        print("First")
    else:
        print("Second")

submit()

Solution (Python):

"""
Created on Sat Apr 25 18:20:35 2020
"""

import sys


sys.setrecursionlimit(10 ** 9)


mod = 10**9+7


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

dp = [i <= K for i in range(K + A[-1]+1)]
for i in range(K, -1, -1):
    for a in A:
        if dp[a+i]:
            dp[i] = False
            break




if dp[0]:
    ans = 'Second'
else:
    ans = 'First'
print(ans)

Solution (Python):

"""
Created on Sat Apr 25 18:20:35 2020
"""

import sys


sys.setrecursionlimit(10 ** 9)


mod = 10**9+7


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

dp = [i <= K for i in range(K + A[-1]+1)]
for i in range(K, -1, -1):
    for a in A:
        if dp[a+i]:
            dp[i] = False
            break




if dp[0]:
    ans = 'Second'
else:
    ans = 'First'
print(ans)

Solution (Python):

"""
Created on Sat Apr 25 18:20:35 2020
"""

import sys
import numpy as np

sys.setrecursionlimit(10 ** 9)


mod = 10**9+7


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

A = list(map(int,input().split()))

dp = [True for i in range(K + A[-1] + 1)]
for i in range(K):
    if dp[i]:
        for a in A:
            dp[i + a] = False




if dp[K]:
    ans = 'Second'
else:
    ans = 'First'
print(ans)

Solution (Python):

"""
Created on Sat Apr 25 18:20:35 2020
"""

import sys
import numpy as np

sys.setrecursionlimit(10 ** 9)
def input():
    return sys.stdin.readline()[:-1]
mod = 10**9+7


N, K = map(int,input().split())
A = np.array(list(map(int,input().split())))


dp = [True for i in range(K + A[-1] + 1)]
for i in range(K):
    if dp[i]:
        for a in A:
            dp[i + a] = False




if dp[K]:
    ans = 'Second'
else:
    ans = 'First'
print(ans)

Solution (Python):

"""
Created on Sat Apr 25 18:20:35 2020
"""

import sys
import numpy as np

sys.setrecursionlimit(10 ** 9)


mod = 10**9+7




N, K, *A = map(int, open(0).read().split())

dp = [True for i in range(K + A[-1] + 1)]
for i in range(K):
    if dp[i]:
        for a in A:
            dp[i + a] = False




if dp[K]:
    ans = 'Second'
else:
    ans = 'First'
print(ans)

Solution (Python):

"""
Created on Sat Apr 25 18:20:35 2020
"""

import sys
import numpy as np

sys.setrecursionlimit(10 ** 9)


mod = 10**9+7


N, K = map(int,input().split())
A = np.array(list(map(int,input().split())))

dp = [True for i in range(K + A[-1] + 1)]
for i in range(K):
    if dp[i]:
        for a in A:
            dp[i + a] = False




if dp[K]:
    ans = 'Second'
else:
    ans = 'First'
print(ans)

Solution (Python):

"""
Created on Sat Apr 25 18:20:35 2020
"""

import sys
import numpy as np

sys.setrecursionlimit(10 ** 9)


mod = 10**9+7


N, K = map(int,input().split())
A = np.array(list(map(int,input().split())))

dp = [True for i in range(K + 1)]
for i in range(K, -1, -1):
    if dp[i]:
        for a in A:
            if i - a >= 0:
                dp[i - a] = False




if dp[0]:
    ans = 'Second'
else:
    ans = 'First'
print(ans)

Solution (Python):

"""
Created on Sat Apr 25 18:20:35 2020
"""

import sys
import numpy as np

sys.setrecursionlimit(10 ** 9)


mod = 10**9+7


N, K = map(int,input().split())
A = np.array(list(map(int,input().split())))

dp = np.arange(K + A[-1]+1) >= 0
for i in range(K, -1, -1):
    if np.all(dp[A+i]):
        dp[i] = False



if dp[0]:
    ans = 'First'
else:
    ans = 'Second'
print(ans)

Solution (Python):
def main():

    from bisect import bisect_left as bl, bisect_right as br, insort
    import sys
    import heapq
    
    from collections import defaultdict as dd, deque
    def data(): return sys.stdin.readline().strip()
    def mdata(): return map(int, data().split())
    out = sys.stdout.write
    

    n, k = mdata()
    a = list(mdata())
    dp = [0]*(k+1)
    for i in range(1, k + 1):
        for j in a:
            if i >= j:
                if dp[i - j] == 0:
                    dp[i] = 1
            if dp[i] == 1:
                break
    print("First" if dp[k] else "Second")


if __name__ == '__main__':
    main()

Solution (Python):
N,K=map(int,input().split())
A=list(map(int,input().split()))

DP=[False]*(K+1)
for i in range(1,K+1):
    for j in range(0,N):
        if A[j]<=i:
            DP[i]=DP[i] or not DP[i-A[j]]
        else:
            break

if DP[K]:
    print('First')
else:
    print('Second')

Solution (Python):
N, K = map(int, input().split())
A = list(map(int, input().split()))

dp = ['First']*(K+1)
dp[0] = 'Second'
def solve(dp):
    for i in range(1,K+1):
        for j in range(N):
            dp[i] = 'Second'
            if dp[i-A[j]]=='Second':
                dp[i] = 'First'
                break
    ans = dp[K]
    return ans
print(solve(dp))

Solution (Python):
N, K = map(int, input().split())
A = list(map(int, input().split()))

dp = ['First']*(K+1)
dp[0] = 'Second'
def solve(dp):
    for i in range(1,K+1):
        for j in range(N):
            dp[i] = 'Second'
            if dp[i-A[j]]=='Second':
                dp[i] = 'First'
                break
    ans = dp[K]
    return ans
print(solve(dp))

Solution (Python):
def solve(ls, k):
	dp = [False for i in range(k + 1)]
	for i in range(k + 1):
		for stone in ls:
			if stone <= i and not dp[i - stone]:
				dp[i] = True
	return dp[k]


n, k = map(int, input().split())
ls = list(map(int, input().split()))
if solve(ls, k):
	print('First')
else:
	print('Second')

Solution (Python):
N, K, *A = map(int, open(0).read().split())

dp = [False] * (2 * K + 1)
for i in range(K):
    if not dp[i]:
        for a in A:
            dp[i + a] = True

if dp[K]:
    print("First")
else:
    print("Second")

Solution (Python):
N, K, *A = map(int, open(0).read().split())

dp = [False] * (K + 1)
for i in range(1, K + 1):
    for a in A:
        if i - a >= 0:
            dp[i] |= not dp[i - a]

if dp[K]:
    print("First")
else:
    print("Second")

Solution (Python):

import sys


def solve(N: int, K: int, a: "List[int]"):

    dp = [False] * (K + 1)
    for i in range(0, K + 1):
        for j in a:
            if i - j >= 0:
                dp[i] = not dp[i - j] or dp[i]

    print("First" if dp[K] else "Second")

    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    K = int(next(tokens))  
    a = [int(next(tokens)) for _ in range(N)]  
    solve(N, K, a)

if __name__ == '__main__':
    main()

Solution (Python):
n, k = map(int, input().split())
a = list(map(int, input().split()))
dp = [0 for _ in range(k + 1)]
for i in range(1, k + 1):
    for j in a:
        if i >= j:
            if dp[i - j] == 0:
                dp[i] = 1
        if dp[i] == 1:
            break
print("First" if dp[k] else "Second")

Solution (Python):
n, k  = map(int, input().split())
A = list(map(int, input().split()))
dp = [0] * (k + 1)

for i in range(1, k + 1):
  if all(dp[i - a] == 1 for a in A if i >= a):
    dp[i] = 0
  else:
    dp[i] = 1

print("First" if dp[k] == 1 else "Second")

Solution (Python):
n,k=map(int,input().split())
a=list(map(int,input().split()))
dp=[False]*(k+1)




for i in range(k+1):
      for ai in a:
            if i+ai<=k and not dp[i]:
                  dp[i+ai]=True
print('First' if dp[k] else 'Second')

Solution (Python):
import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline
n,k=map(int,input().split())
a=list(map(int,input().split()))



dp=[False for _ in range(k+1)]
calted=[False for _ in range(k+1)]


mi=min(a)
ma=max(a)
for ai in a:
	dp[ai]=True
	calted[ai]=True

for i in range(mi+1,k+1):
      if calted[i]:
            continue
      il=[i-ai for ai in a if i-ai>=0]
      f=1
      for l in il:
        f*=dp[l]
      if f == 0:
            dp[i]=True
      else:
            dp[i]=False
print('First' if dp[k] else 'Second')

Solution (Python):
n, k = map(int, input().split())
*A, = map(int, input().split())
DP = [False] * (k+1)
for i in range(k+1):
    for a in A:
        if i+a <= k and not DP[i]:
            DP[i+a] = True
if DP[k]:
    print('First')
else:
    print('Second')

Solution (Python):
n, k = map(int, input().split())
A = list(map(int, input().split()))
dp = [0]*(k+1)
for i in range(1, k+1):
    for j in range(n):
        if i-A[j] < 0:
            continue
        dp[i] |= not dp[i-A[j]]
print('First' if dp[k] else 'Second')

Solution (Python):
n, k = map(int, input().split())
A = list(map(int, input().split()))

dp = [0]*(k+1)

for i in range(1, k+1):
    for j in range(n):
        if i-A[j] < 0:
            continue
        dp[i] = max(dp[i], 1 if dp[i-A[j]] == 0 else 0)
print('First' if dp[k] else 'Second')

Solution (Python):
N, K = map(int, input().split())
A = list(map(int, input().split()))

dp = [False] * (10 ** 5 + 10)
for i in range(1, K+1):
    
    
    
    
    dp[i] = not all(dp[i-a] if i-a >= 0 else True for a in A)

print("First" if dp[K] else "Second")

Solution (Python):
N, K = map(int, input().split())
A = list(map(int, input().split()))

dp = [False] * (10 ** 5 + 10)
for i in range(1, K+1):
    dp[i] = not all(dp[i-a] if i-a >= 0 else True for a in A)

print("First" if dp[K] else "Second")

Solution (Python):
import sys

sys.setrecursionlimit(10**5+10)

input = lambda: sys.stdin.readline().rstrip()

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


dp = [[-1, -1] for _ in range(K+1)]
dp[0] = [0, 0]

for i in range(1, K+1):
    for j in range(2):
        if dp[i][j] > -1:
            continue

        flag = 1
        for x in a:
            if i >= x:
                flag *= dp[i-x][1-j]
        if flag == 0:
            dp[i][j] = 1
        else:
            dp[i][j] = 0
            
print("First" if dp[K][0] else "Second")

Solution (Python):
n,k=map(int,input().split())
a=list(map(int,input().split()))
dp=[0]*(k+1+1234)

for i in range(0,k+1):
    if dp[i] == 0:
        for x in a:
            dp[min(i+x,k+1)] =1

print("First" if dp[k] else "Second")

Solution (Python):
n,k = map(int, input().split())
a = list(map(int, input().split()))
ans=[False]*(k+1)
ans[0]=False

for i in range(k+1):
    for num in a:
        if (i-num >=0) and (not ans[i-num]):
            ans[i]=True

if ans[-1]:
    print("First")
else:
    print("Second")

Solution (Python):
n,k = map(int, input().split())
a = list(map(int, input().split()))
ans=[-1]*(k+1)
ans[0]=False 

for i in range(k+1):
    iswin = False
    for num in a:
        if (i-num >=0) and (not ans[i-num]):
            iswin=True
    ans[i]=iswin

if ans[-1]:
    print("First")
else:
    print("Second")

Solution (Python):
N,K=map(int,input().split())
A=list(map(int,input().split()))

dp=[[0 for i in range(0,2)] for i in range(0,K+1)]

dp[0][0]='Second'
dp[0][1]='First'

for i in range(1,K+1):
    ans='Second'
    for j in A:
        if i>=j and dp[i-j][1]=='First':
            ans='First'
    dp[i][0]=ans

    ans='First'
    for j in A:
        if i>=j and dp[i-j][0]=='Second':
            ans='Second'
    dp[i][1]=ans

print(dp[K][0])

Solution (Python):

n,k=map(int,input().split())
a=list(map(int,input().split()))
dp=[0]*(k+1)
for i in range(1,k+1):
    for j in range(n):
        if i-a[j]>=0 and dp[i-a[j]]==0:
            dp[i]=1

print("First" if dp[k] else "Second")