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):
def examA():
    N = I()
    H = LI()
    dp = [inf]*(N)
    dp[0] = 0
    for i in range(N-1):
        dp[i+1] = min(dp[i+1],dp[i]+abs(H[i+1]-H[i]))
        if i<N-2:
            dp[i + 2] = min(dp[i + 2], dp[i]+abs(H[i + 2] - H[i]))
    ans = dp[-1]
    print(ans)
    return

def examB():
    N, K = LI()
    H = LI()
    dp = [inf]*N
    dp[0] = 0
    for i in range(N):
        for k in range(1,K+1):
            if i+k>=N:
                break
            if dp[i+k]>dp[i]+abs(H[i+k]-H[i]):
                dp[i+k] = dp[i]+abs(H[i+k]-H[i])
    ans = dp[-1]
    print(ans)
    return

def examC():
    N = I()
    A = [0]*N; B = [0]*N; C = [0]*N
    for i in range(N):
        A[i],B[i],C[i] = LI()
    dp = [[0]*3 for _ in range(N+1)]
    for i in range(N):
        dp[i+1][0] = max(dp[i][1],dp[i][2]) + A[i]
        dp[i + 1][1] = max(dp[i][0], dp[i][2]) + B[i]
        dp[i + 1][2] = max(dp[i][1], dp[i][0]) + C[i]
    ans = max(dp[N])
    print(ans)
    return

def examD():
    ans = 0
    print(ans)
    return

def examE():
    ans = 0
    print(ans)
    return

def examF():
    
    S = SI(); N = len(S)
    T = SI(); M = len(T)
    dp = [[0] * (M + 1) for _ in range(N + 1)]
    for i in range(N):
        for j in range(M):
            if S[i] == T[j]:
                dp[i + 1][j + 1] = max(dp[i + 1][j + 1], dp[i][j] + 1)
            dp[i+1][j+1] = max(dp[i+1][j+1], dp[i+1][j], dp[i][j+1])

    i = N; j = M
    ans = []
    while i > 0 and j > 0:
        if dp[i][j] == dp[i-1][j]:
            i -= 1
        elif dp[i][j] == dp[i][j-1]:
            j -= 1
        else:
            ans.append(S[i-1])
            i -= 1
            j -= 1
    print("".join(ans[::-1]))
    return

def examG():
    
    
    def topological_sort(n,outs,ins):
        q = deque(v1 for v1 in range(n) if ins[v1] == 0)
        res = []
        while q:
            v1 = q.popleft()
            res.append(v1)
            for v2 in outs[v1]:
                ins[v2] -= 1
                if ins[v2] == 0:
                    q.append(v2)
        return res
    N, M = LI()
    V = [[]for _ in range(N)]
    start = [0]*N
    for _ in range(M):
        x,y = LI()
        x -= 1; y -= 1
        V[x].append(y)
        start[y] += 1
    Order = topological_sort(N, V, start)

    dp = [0]*N
    for i in Order:
        for v in V[i]:
            dp[v] = max(dp[v],dp[i]+1)
    ans = max(dp)
    print(ans)
    return

def examH():
    H, W = LI()
    A = [SI() for _ in range(H)]
    dp = [[0]*W for _ in range(H)]
    dp[0][0] = 1
    for i in range(H):
        for j in range(W):
            if A[i][j]=="
                continue
            dp[i][j] %=mod
            if i+1<H and dp[i+1][j]!="
                dp[i+1][j] +=dp[i][j]
            if j+1<W and dp[i][j+1]!="
                dp[i][j+1] +=dp[i][j]
    ans = dp[-1][-1]
    print(ans)
    return

def examI():
    N = I()
    P = LFI()
    dp = [[0]*(N+1) for _ in range(N+1)]
    dp[0][0] = 1
    for i in range(N):
        for j in range(i+1):
            dp[i+1][j+1] += dp[i][j]*P[i]
            dp[i+1][j] += dp[i][j]*(1-P[i])
    ans = 0
    for v in dp[N][(1+N//2):]:
        ans += v
    print(ans)
    return

def examJ():
    N = I()
    A = LI()
    dp = [[[0]*(N+1) for _ in range(N+1)]for _ in range(N+1)]
    S = Counter(A)
    print(S)
    dp[S[1]][S[2]][S[3]] = 0
    que = deque()
    que.append((S[1],S[2],S[3]))
    used = defaultdict(set)
    while(que):
        n1,n2,n3 = que.popleft()
        if used[(n1,n2,n3)]:
            continue
        used[(n1,n2,n3)] = True
        now = n1+n2+n3
        if n1>0:
            dp[n1-1][n2][n3] += dp[n1][n2][n3] + N/now * n1/now
            que.append((n1-1, n2, n3))
        if n2>0:
            dp[n1+1][n2-1][n3] += dp[n1][n2][n3] + N/now * n2/now
            que.append((n1+1,n2-1,n3))
        if n3>0:
            dp[n1][n2+1][n3-1] += dp[n1][n2][n3] + N/now * n3/now
            que.append((n1,n2+1,n3-1))

    ans = dp[0][0][0]
    print(ans)
    return

def examK():
    N, K = LI()
    A = LI()
    dp = [-1]*(K+1)
    for i in range(1,K+1):
        flag = False
        for a in A:
            if a>i:
                break
            if dp[i-a]==-1:
                flag = True
                break
        if flag:
            dp[i] = 1

    ans = dp[K]
    if ans==1:
        print("First")
    else:
        print("Second")
    return

def examM():
    N, K = LI()
    A = LI()
    dp = [[0]*(K+1) for _ in range(N+1)]
    dp[0][0] = 1
    for i in range(N):
        cum = [0]*(K+1)
        cum[0] = dp[i][0]
        for c in range(K):
            cum[c+1] = cum[c] + dp[i][c+1]
        for j in range(K+1):
            if j<=A[i]:
                dp[i+1][j] = cum[j]
            else:
                dp[i+1][j] = cum[j] - cum[j-A[i]-1]
            dp[i+1][j] %=mod

    ans = dp[N][K]%mod
    print(ans)
    return

def examP():
    def dfs_dp(n,s,fords):
        W = 1; B = 1
        for v in fords[s]:
            W *= sum(dfs_dp(n, v, fords)[v])
            B *= dfs_dp(n, v, fords)[v][0]
        return (W,B)
    N = I()
    V = [[]for _ in range(N)]
    for _ in range(N-1):
        x,y = LI()
        x -=1; y -=1
        V[x].append(y)
        V[y].append(x)
    ans = dfs_dp(N,0,V)
    print(ans)
    print("nemui")
    return

import sys,copy,bisect,itertools,heapq,math
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LFI(): return list(map(float,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,mod2,inf,alphabet
mod = 10**9 + 7
mod2 = 998244353
inf = 10**18
alphabet = [chr(ord('a') + i) for i in range(26)]

sys.setrecursionlimit(10**7)

if __name__ == '__main__':
    examK()

"""

"""

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

dp = [0 for i in range(k+1)]

for i in range(k+1):
    for a in al:
        if a <= i:
            if dp[i-a] == 0:
                dp[i] = 1


if dp[-1] % 2 == 0:
    print("Second")
else:
    print("First")

Solution (Python):

"""
Created on Sun Jan 19 20:52:57 2020

@author: over-
"""


N, K=map(int,input().split())
a=input().split()
a=[int(i) for i in a]
a.sort()

dp=[0]*(K+1)
dp[0]=1

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

    
if dp[-1]==0:
    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 a in A:
        if i-a >= 0 and dp[i-a] == False:
            dp[i] = True
            break
print("First" if dp[-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(1,K+1):
    for a in A:
        if i-a >= 0 and dp[i-a] == False:
            dp[i] = True
            break
print("First" if dp[-1] else "Second")

Solution (Python):
N, K = map(int, input().split())
A = list(map(int, input().split()))
A.sort()
max_a = A[-1]

dp = [0] * (K+1)

for a in A:
    dp[a] = 1

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


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

Solution (Python):
N, K = map(int, input().split())
A = list(map(int, input().split()))
A.sort()
max_a = A[-1]

dp = [0] * (K+1)

for a in A:
    dp[a] = 1

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


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

Solution (Python):
def solve(N, K, cards):
  min_elem = cards[0]

  
  dp = [False for _ in range(K + 1)]
  for i in range(min_elem):
    dp[i] = False

  for k in range(1, K + 1):
    for c in cards:
      if c > k:
        break
      if k - c >= 0 and dp[k - c] == False:
        dp[k] = True

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

  
def iln(): return list(map(int, input().split()))


N, K = iln()
cards = iln()
solve(N, K, cards)

Solution (Python):
import sys
input = sys.stdin.readline

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

dp= [-1 for i in range(K+1)]
dp[0] = 0
for i in range(1,K+1):
	check = False
	for j in lst_a:
		if(i-j>=0):
			if (dp[i-j] == 0):
				check = True
	if(check): dp[i]= 1
	else : dp[i]= 0

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

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

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


dp = [False]*(K+1)

for i in range(1, K+1):
    for j in range(N):
        
        
        if i >= a[j]:
            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()))
A.sort()
m = A[0]

dp = [False] * (K+1)

for k in range(m, K+1):
  for a in A:
    if k - a < 0:
      continue
    if not dp[k-a]:
      dp[k] = True
      break

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

Solution (Python):
N, K = map(int, input().split())
As = list(map(int, input().split()))
d = [True]+[True]*K
for i in range(1, K+1):
    for a in As:
        if i-a<0:
            continue
        if d[i-a]:
            d[i] = False
            break

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

Solution (Python):
def stones(k, moves):
    winnable = [False] * (k + 1)
    for i in range(1, k+1):
        winnable[i] = not all(winnable[i - j] for j in moves if j <= i)
    return ["Second", "First"][winnable[k]]

def main():
    n, k = [int(x) for x in input().split()]
    moves = [int(x) for x in input().split()]
    return stones(k, moves)

print(main())

Solution (Python):
import math
import sys

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

dp = [False] * (K + 1)
for i in range(K + 1):
    for a in As:
        if i + a <= K:
            dp[i + a] |= (not dp[i])
        else:
            break
ans = "First" if dp[K] else "Second"
print(ans)

Solution (Python):
import math
import sys

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

dp = [False] * (K + 1)
for i in range(K + 1):
    for a in As:
        if i + a <= K:
            dp[i + a] |= (not dp[i])
ans = "First" if dp[K] else "Second"
print(ans)

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




import pdb

tmp = [0 for _ in range(N)]
tmp_win = [0 for _ in range(N)]
win = [0 for _ in range(K+1)]

flg = 0



for stones in range(K+1):
  for i in range(N):
    
    tmp[i] = stones - As[i]
    if tmp[i] == 0:
      
      flg = 1

  if flg == 1:
    
    win[stones] = 1
    flg = 0
    continue

  if max(tmp) < 0:
    
    win[stones] = -1
    continue

  
  win[stones] = -1    
  for i in range(N):
    
    tmp_win = win[tmp[i]]
    if tmp_win == -1:
      
      
      win[stones] = 1
      break


winner = ['', 'First', 'Second']
print(winner[win[K]])

Solution (Python):
def wczytaj_liste(): 
    wczytana_lista = input()
    lista_znakow = wczytana_lista.split()
    ostateczna_lista = []
    for element in lista_znakow:
        ostateczna_lista.append(int(element))
    return ostateczna_lista


def kamienie_niemilosci(): 
    N, K = wczytaj_liste()
    A = wczytaj_liste()
    win = {1:'First', 2:'Second'}
    odp = []
    for i in range(K+1):
        if i < A[0]:
            odp.append(2)
        else:
            czy_istnieje = False
            for male_a in A: 
                if i - male_a >= 0 and odp[i-male_a] == 2: 
                    czy_istnieje = True
            if czy_istnieje: 
                odp.append(1)
            else: 
                odp.append(2)
    print(win[odp[K]])
    
kamienie_niemilosci()

Solution (Python):
n, k = map(int, input().split())
a = [int(x) for x in input().split()]

dp = []

for i in range(k+1):
    First_win = any(map(lambda x: not dp[i-x] if i-x >= 0 else False, a))
    dp.append(First_win)

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

Solution (Python):
n, k = map(int, input().split())
a = [int(x) for x in input().split()]

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

for i in range(min(a)):
    dp[i] = 1

for i in range(k+1):
    tmp = 0
    for x in a:
        if i-x < 0:
            continue
        else:
            tmp += dp[i-x]
    if tmp > 0:
        dp[i] = 0
    else:
        dp[i] = 1

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)

for i in range(a[0]):
    dp[i] = 2

for i in range(a[0],k+1):
    for j in a:
        if(j > i):
            dp[i] = 2
            break
        if(dp[(i-j)]==2):
            dp[i] = 1
            break
        dp[i] = 2

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

Solution (Python):

import sys
INF = float("inf")


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

    
    dp = [1]*(K+1)
    dp[0] = 1
    for k in range(1, K+1):
        dp[k] = 1
        for i in range(N):
            if k-a[i] >= 0 and dp[k-a[i]] == 1:
                dp[k] = 0
    print("First" if dp[K] == 0 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):
import sys
sys.setrecursionlimit(2*10**5)

def rec(i, A, memo):
    if memo[i] != -1:
        return memo[i]

    for a in A:
        if i - a >= 0 and not rec(i - a, A, memo):
            memo[i] = True
            return True
    memo[i] = False
    return False


def main():
    N, K = map(int, input().split())
    A = [int(x) for x in input().split()]
    memo = [-1] * (K + 1)
    print("First" if rec(K, A, memo) else "Second")


if __name__ == '__main__':
    main()

Solution (Python):


def main():
    N, K = map( int ,input().split())
    A = list( map(int, input().split()))
    dp = [False]*(K+1)
    for i in range(A[0],K+1):
        for a in A:
            if a > i:
                break
            dp[i] |= not dp[i-a]
    if dp[K]:
        print("First")
    else:
        print("Second")
if __name__ == '__main__':
    main()

Solution (Python):


def main():
    N, K = map( int ,input().split())
    A = list( map(int, input().split()))
    dp = [False]*(K+1)
    for i in range(A[0],K+1):
        for a in A:
            if a > i:
                break
            dp[i] |= not dp[i-a]
    if dp[K]:
        print("First")
    else:
        print("Second")
if __name__ == '__main__':
    main()

Solution (Python):


def main():
    N, K = map( int, input().split())
    A = list( map( int, input().split()))
    dp = [[None]*2 for _ in range(K+1)]
    for i in range(A[0]):
        dp[i][0] = False
        dp[i][1] = True
    for k in range(A[0], K+1):
        win = False
        for a in A:
            if a <= k:
                if dp[k-a][1]:
                    win = True
                    break
        dp[k][0] = win
        win = True
        for a in A:
            if a <= k:
                if not dp[k-a][0]:
                    win = False
                    break
        dp[k][1] = win
    if dp[K][0]:
        print("First")
    else:
        print("Second")

if __name__ == '__main__':
    main()

Solution (Python):
n, k = map(int, input().split())
arr = [int(x) for x in input().split()]

dp = [False] * (k+1)

for stones in range(k+1):
    for num in arr:
        
        if stones >= num and not dp[stones-num]:
            dp[stones] = True

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

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

dp = [False]*(k+1)
for j in range(1,k+1):
    tmp = False
    for i in range(n):
        if a[i] > j:
            continue
        if not dp[j-a[i]]:
            tmp = True
    dp[j] = tmp

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

Solution (Python):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

N,K = map(int,input().split())
A = [int(i) for i in input().split()]


dp = [False] * (K+1)


dp[0] = False

for i in range(K+1):
    for a in A:
        if i+a > K:
            continue
        dp[i+a] |= not dp[i]

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

Solution (Python):
def main():
	n, k, *a = map(int, open(0).read().split())
	g = [0] * (k + 1)
	for i in range(min(a), k + 1):
		s = set(g[i - x] for x in a if i >= x)
		r = 0
		while r in s:
			r += 1
		g[i] = r
	print("First" if g[-1] else "Second")
	
if __name__=="__main__":
	main()

Solution (Python):
n, k, *a = map(int, open(0).read().split())
g = [0] * (k + 1)
for i in range(min(a), k + 1):
	s = set(g[i - x] for x in a if i >= x)
	r = 0
	while r in s:
		r += 1
	g[i] = r
print("First" if g[-1] else "Second")

Solution (Python):



def main():
    n, k = map(int, input().split())
    a = list(map(int, input().split()))
    dp = [0 for _ in range(k + 1)]  

    
    
    
    for i in range(k):
        
        if dp[i]:
            continue

        
        for ai in a:
            
            
            if i + ai > k:
                break

            
            dp[i + ai] = 1

    if dp[-1] == 1:
        print('First')
    else:
        print('Second')


if __name__ == '__main__':
    main()

Solution (Python):



def main():
    n, k = map(int, input().split())
    a = list(map(int, input().split()))
    dp = [0 for _ in range(k + 1)]

    
    
    for i in range(k):
        if dp[i]:
            continue

        for ai in a:
            if i + ai > k:
                break

            dp[i + ai] = 1

    if dp[-1] == 1:
        print('First')
    else:
        print('Second')


if __name__ == '__main__':
    main()

Solution (Python):
N,K = map(int, input().split())
A = [int(a) for a in input().split()]

dp = [False]*(K+1)

for i in range(K+1):
    f = False
    for j in range(N):
        if A[j] > i:
            break
        if dp[i-A[j]]:
            continue
        f = True
    dp[i] = f
    
if dp[K]:
    ans = "First"
else:
    ans = "Second"
        
print(ans)

Solution (Python):
N, K = map(int, input().split())
a = [int(c) for c in input().split()]


dp = [False] * (K+1)
for k in range(K+1):
    for ai in a:
        if k >= ai:
            dp[k] = dp[k] or (not dp[k-ai])

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

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(K+1):
    if i<A[0]:
        dp[i] = 0
    else:
        dp[i] = not dp[i-A[0]]
        for j in range(1,N):
            if i>=A[j]:
                dp[i] = dp[i] or not dp[i-A[j]]
if dp[K]==True:
    print("First")
else:
    print("Second")

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(K+1):
    if i<A[0]:
        dp[i] = 0
    else:
        dp[i] = not dp[i-A[0]]
        for j in range(1,N):
            if i>=A[j]:
                dp[i] = dp[i] or not dp[i-A[j]]
if dp[K]==True:
    print("First")
else:
    print("Second")

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(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 = [int(x) for x in input().strip().split()]
a = [int(x) for x in input().strip().split()]
a.sort()
dp = {} 
for i in range(k+1):
    dp[i] = False

for e in a:
    dp[e] = True

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

if dp[k] is False:
    print('Second')
else:
    print('First')

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

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

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

Solution (Python):
N,K=map(int,input().split())
S=[int(i) for i in input().split()]

dp=[False]*(K+1)

for i in range(K+1):
    
    for s in S:
        f=False
        if i-s<0:
            break
        if not dp[i-s]:
            dp[i]=True
            break

if dp[-1]:
    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(K):
    for a in A:
        if dp[i] == 0:
            if i + a <= K:
                dp[i+a] = 1

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

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

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


if __name__ == '__main__':
    p_k()

Solution (Python):
N, K = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
dp = [0]*(K+1)
for i in range(1, K+1):
    flag = 0
    for ai in a:
        if i-ai<0:
            break
        if dp[i-ai] == 0:
            flag = 1
    dp[i] = flag
if dp[-1] == 1:
    print('First')
else:
    print('Second')

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

dp=[False]*(k+1+max(a))

for i in range(1+k):
  if not dp[i]:
    for x in a:
      dp[i+x]=True

print(("Second","First")[dp[k]])

Solution (Python):
N,K=map(int,input().split())
a=list(map(int,input().split()))
dp=[[0,0]  for j in range(K+1)]
for i in range(1,K+1):
    for j in range(N):
        if i-a[j]>=0:
            dp[i][0]=max((dp[i-a[j]][1]+1)%2,dp[i][0])
            dp[i][1]=max((dp[i-a[j]][0]+1)%2,dp[i][1])
        
if dp[K][0]:
    print("First")
else:
    print("Second")

Solution (Python):
N,K=map(int,input().split())
a=list(map(int,input().split()))
dp=[0 for j in range(K+1)]
for i in range(1,K+1):
    for j in range(N):
        if i-a[j]>=0:
            dp[i]=max((dp[i-a[j]]+1)%2,dp[i])
if dp[K]:
    print("First")
else:
    print("Second")

Solution (Python):
import sys
sys.setrecursionlimit(10 ** 6)


def main():
    N, K = map(int, input().split())
    A = tuple(sorted(map(int, input().split())))
    c = [0] * (K + 1)
    def dp(k, A, c, turn):
        if c[k] != 0:
            return c[k] * turn
        for i in A:
            if i > k:
                break
            if dp(k - i, A, c, -turn) == turn:
                c[k] = 1
                return turn
        c[k] = -1
        return -turn
    
    print('First' if dp(K, A, c, 1) == 1 else 'Second')


main()

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

def main():
    l = [False] * (K+1)
    for i in range(a[0] -1, K+1):
        l[i] = any(not l[i-j] if i >= j else False for j in a)
    if l[-1]:
        print('First')
    else:
        print('Second')


main()

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

def main():
    l = [False] * (K+1)
    for i in range(a[0] -1, K+1):
        l[i] = any(not l[i-j] if i >= j else False for j in a)
    if l[-1]:
        print('First')
    else:
        print('Second')


main()

Solution (Python):
def stones(a,k): 
    n=len(a)
    dp=[False for _ in range(k+1)] 
    for i in range(k+1):
        for j in range(n):
            if i-a[j]>=0:
                if not dp[i-a[j]]:
                    dp[i]=True
    if dp[k]:
        print("First")
    else:
        print("Second")


def main():
    n,k = map(int,input().split()) 
    a = list(map(int,input().split()))
    a.sort()
    stones(a,k)
if __name__ == "__main__":
    main()

Solution (Python):
import sys
read = sys.stdin.read
readline = sys.stdin.readline

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

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

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

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

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

dp = [0]*(K+K+1)
for n in range(K):
    if not dp[n]:
        for a in A:
            dp[n+a]=1

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

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

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

dp = [0]*(K+K+1) 
for n in range(K):
    if not dp[n]:
        for a in A:
            dp[n+a]=1

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

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

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

dp = [0]*(K+1) 
for n in range(K):
    if not dp[n]:
        for a in A:
            if n+a>K:
                break
            dp[n+a]=1

answer = 'First' if dp[-1] else 'Second'
print(answer)

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

from operator import xor
from functools import reduce

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

a = reduce(xor,(1<<a for a in A))

dp = 0 
for n in range(K):
    if not(dp&(1<<n)):
        dp |= (a<<n)

answer = 'First' if dp&(1<<K) else 'Second'
print(answer)

Solution (Python):
WIN  = 1
LOSE = 0

N, K = map(int, input().split())
a = [int(i) for i in input().split()]

Sa = set(a)
Sk = set()

dp = [LOSE] * (K+1)

for k in range(1, K+1):
    if k in Sa: 
        dp[k] = WIN
        Sk.add(k)
    else:
        for i in range(N):
            if k-a[i] >0:
                if k-a[i] not in Sk:
                    dp[k] = WIN
                    Sk.add(k)
                    break



if dp[-1] == 1:
    print('First')
else:
    print('Second')

Solution (Python):
import sys
n, k = [int(i) for i in sys.stdin.readline().split()]
a_ls = [int(i) for i in sys.stdin.readline().split()]
memo_ls = [-1 for i in range(k+1)]
memo_ls[0] = -1
for i in range(1, k+1):
    for a in a_ls:
        if a > i:
            continue
        memo_ls[i] = max(memo_ls[i - a] * (-1), memo_ls[i])
ans = ["","First", "Second"]
print(ans[memo_ls[-1]])

Solution (Python):
n,k = map(int,input().split())
A = list(map(int,input().split()))
dp = [-1]*(k+1) 
for i in range(1,k+1):
    for a in A:
        if a <= i and dp[i-a] == -1:
            dp[i] = 1
            break



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

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



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

Solution (Python):
n,k=map(int,input().split())
a=list(map(int,input().split()))
a.sort()
dp=[0]*(k+1)
for i in range(a[0]):
    dp[i]="s"
for u in a:
    dp[u]="f"
for i in range(a[0]+1,k+1):
    if dp[i]==0:
        for u in a:
            if i<u:
                continue
            else:
                if dp[i-u]=="s":
                    dp[i]="f"
                    break
        else:
            dp[i]="s"
if dp[k]=="f":
    print("First")
else:
    print("Second")

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

    dp = [0] * (k+1)
    
    for i in range(k+1):
        for a in a_list:
            if dp[i] == 0:
                idx = i + a
                if idx < k+1:
                    dp[idx] = 1

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


if __name__ == '__main__':
    main()

Solution (Python):
import sys
input = sys.stdin.readline

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 not(dp[i-a[j]]):
            dp[i]=True
            break
if dp[K]:
    print("First")
else:
    print("Second")

Solution (Python):
import bisect

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):
  rank = bisect.bisect_right(A, i)
  if rank == 0:
    dp[i] = 0
  else:
    for j in range(rank):
      if i-A[j] >= 0 and dp[i-A[j]] == 0:
        dp[i] = 1
        break
print('First' if dp[K] == 1 else 'Second')

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

dp = [-1] * (K+1)
ans = int(0)

for i in a:
    dp[i] = int(1)

for i in range(K+1):
    v = int(-1)
    for j in a:
        if i>j and dp[i-j]==-1:
            v = int(1)
    if dp[i]==-1:
        dp[i] = v

if dp[K]==1:
    ans = "First"
else:
    ans = "Second"

print(ans)