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):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

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

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

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

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 a:dp[i]=max((i-j>=0)*(dp[i-j]==0),dp[i])
print(["Second","First"][dp[-1]])

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


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

Solution (Python):
def solve():
    k, a = read()
    result = think(k, a)
    write(result)


def read():
    n, k = read_int(2)
    a = read_int(n)
    return k, a


def read_int(n):
    return list(map(lambda x: int(x), read_line().split(' ')))[:n]


def read_float(n):
    return list(map(lambda x: float(x), read_line().split(' ')))[:n]


def read_line(n=0):
    if n == 0:
        return input().rstrip()
    else:
        return input().rstrip()[:n]


def think(k, a):
    max_n = 100

    
    dp = [False] * (k + max_n + 1)

    for i in range(len(dp)):
        for elem in a:
            if i >= elem:
                dp[i] |= not dp[i - elem]

    return dp[k]


def write(result):
    if result:
        print('First')
    else:
        print('Second')


if __name__ == '__main__':
    solve()

Solution (Python):
n,k=map(int,input().split())
a=[int(i) for i in input().split()]
dp=[0 for i in range(k+1)]

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

Solution (Python):
import sys
 
input = sys.stdin.readline
 
N, K = map(int, input().rstrip("\n").split())
a = [int(i) for i in input().rstrip("\n").split()]

dp = [True for j in range(K+1)]
dp[0] = False

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

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

Solution (Python):
n , k = map(int,input().split())
a = list(map(int,input().split()))
a.sort()
path = [0 for _ in range(k+1)]

for i in range(k+1):
    if path[i]==0:
        for v in a:
            if i+v<=k:
                path[i+v]=1
            else:
                break
print('First' if path[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):
    if dp[i]==0:
        for j in a:
            if i+j<=K:
                dp[i+j] = 1

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

Solution (Python):
n,k,*a=map(int,open(0).read().split())
dp=[0]*-~k
for i,d in enumerate(dp):
  if d:continue
  for j in a:
    if i+j<=k:
      dp[i+j]=1
print('SFeicrosntd'[dp[k]::2])

Solution (Python):
n,k,*a=map(int,open(0).read().split())
dp=[0]*-~k
for i,d in enumerate(dp):
  if d:continue
  for j in a:
    if i+j<=k:
      dp[i+j]=1
print('SFeicrosntd'[dp[k]::2])

Solution (Python):
import math
import sys
MAX_INT = int(10e10)
MIN_INT = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

N,K = IL()
a = IL()

dp = [-1]*200010
for i in a:
  dp[i] = True

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

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] * (K+1)

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

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

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

def mex(L):
  L.sort()
  ans = 0
  for i in L:
    if i <= ans:
      ans += 1
    else:
      break
  return ans

DP = [0] * (K + 1)
M = 100000

for i in range(a[0], K + 1):
  L = []
  for j in range(N):
    if i - a[j] < 0:
      break
    L.append(DP[i - a[j]])
  DP[i] = mex(L)

if DP[-1] == 0:
  print("Second")
else:
  print("First")

Solution (Python):
n,k = map(int, input().split())
a = list(map(int, input().split()))
gru = [0]*(k+1)
for i in range(1,k+1):
  for x in a:
    if i-x >= 0 and gru[i-x] == 0:
      gru[i] = 1
      break
t = ["Second","First"]
print(t[gru[k]])

Solution (Python):
n,k = map(int, input().split())
a = list(map(int, input().split()))
gru = [0]*(k+1)
for i in range(1,k+1):
  for x in a:
    if i-x >= 0 and gru[i-x] == 0:
      gru[i] = 1
      break
t = ["Second","First"]
print(t[gru[k]])

Solution (Python):
import sys
sys.setrecursionlimit(10**7)
INTMAX = 9223372036854775807
INTMIN = -9223372036854775808
MOD = 1000000007
def POW(x, y): return pow(x, y, MOD)
def INV(x, m=MOD): return pow(x, m - 2, m)
def DIV(x, y, m=MOD): return (x * INV(y, m)) % m
def LI(): return [int(x) for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LS(): return input().split()
def II(): return int(input())

N,K=LI()
INL=LI()
DP=[False]*(K+1)

for i in range(0,K+1):
    for v in INL:
        if v+i <= K:
            DP[v+i] = DP[v+i] or not DP[i]


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

Solution (Python):

from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
from functools import reduce
import sys
import math
import bisect
import random
import threading
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def LI(): return list(map(int, sys.stdin.readline().split()))
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return list(map(float, sys.stdin.readline().split()))
def LS():return sys.stdin.readline().split()
def SR(n): return [list(sys.stdin.readline())[:-1] for i in range(n)]
def IR(n): return [int(sys.stdin.readline()) for i in range(n)]
def LIR(n): return [list(map(int, sys.stdin.readline().split())) for i in range(n)]
def LSR(n): return [list(map(list, sys.stdin.readline().split())) for i in range(n)]
_gcd = lambda x, y: _gcd(y, x%y) if (x%y) else y
_lcm = lambda x, y: x*y // _gcd(x, y)
def gcd(*numbers):
    return reduce(_gcd, numbers)
def lcm(*numbers):
    return reduce(_lcm, numbers)
sys.setrecursionlimit(1000000)
INF = float('inf')
mod = 1000000007
dire4 = [(1,0), (0,1), (-1,0), (0,-1)]
dire8 = [(1, 0), (1, 1), (0, 1), (-1, 1), (-1, 0), (-1, -1), (0, -1), (1, -1)]

N, K = LI()
A = LI()

dp = [False]*(K+1)
for a in A:
    dp[a] = True

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

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

Solution (Python):
from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,copy,time
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inp(): return int(input())
def inpl(): return list(map(int, input().split()))
def inpl_str(): return list(input().split())

N,K = inpl()
aa = inpl()
dp = [0]*(K+1) 

for i in range(aa[0]):
    dp[i] = -1

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

    if dp[i] == 0:
        dp[i] = -1

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

Solution (Python):
N,K=list(map(int,input().strip().split(" ")))
A=list(map(int,input().strip().split(" ")))
dp=[0]*(K+1)
dp[0]=0
for i in range(1,len(dp)):
    
    for j in range(len(A)):
        if i<A[j]:
            break
        
        if dp[i-A[j]]==0:
            dp[i]=1
if dp[-1]==1:
    print("First")
else:
    print("Second")

Solution (Python):


import sys

class KStones:
    def solve(self):
        n, k = [int(_) for _ in input().split()]
        a = [int(_) for _ in input().split()]
        dp = [0] * (k + 1) 
        for i in range(min(a), k + 1):
            dp[i] = int(any(not dp[i - x] for x in a if x <= i))
        
        print("First" if dp[k] else "Second")

solver = KStones()
input = sys.stdin.readline

solver.solve()

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

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

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

Solution (Python):
import sys
input = sys.stdin.readline
'''
allinputs = iter(input().splitlines())
input = lambda : next(allinputs)

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

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

for i in range(1, K + 1):
	dp[i] = 2
	
	for x in a:
		if i - x >= 0 and dp[i - x] == 2:
			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=[0]*(k+1)

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


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

Solution (Python):
import fileinput


def who_wins(k, move_list):
    arr = [False] * (k + 1)
    for i in range(1, k + 1):
        for move in move_list:
            if move > i:
                continue
            if arr[i - move] is False:
                arr[i] = True
                break
    return arr[-1]


inp = fileinput.FileInput()
k = int(inp.readline().split(" ")[-1])
move_list = [int(m) for m in inp.readline().split(" ")]

if who_wins(k, move_list):
    print("First")
else:
    print("Second")

Solution (Python):

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


dp = [None] * (K + 1)


dp[0] = False


for n in range(1, K + 1):
    
    ta = [x for x in A if x <= n]
    
    
    if len(ta) == 0:
        dp[n] = False
    else:
        res = True
        for a in ta:
            res = res and dp[n - a]
        dp[n] = not res

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

Solution (Python):
import numpy as np
N,K = map(int,input().split())
a = list(int(i) for i in input().split())
res = [0]*(K+1)
for i in range(K):
  for k in a:
    if res[i] == 0:
      if i+k > K:
        break
      else:
        res[i+k] =1
if res[-1] == 1:
  print('First')
else:
  print('Second')

Solution (Python):
from collections import Counter
N, K = map(int,input().split())
A = list(map(int,input().split()))
dp = [0]*(K+1)

for i in range(K+1):
    d = set(range(N + 1))
    for a in A:
        if i - a < 0:
            continue
        if dp[i - a] in d:
            d.remove(dp[i - a])
    dp[i] = min(list(d))

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

Solution (Python):


import sys
sys.setrecursionlimit(10**7)

n,k = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
a.sort()


memo = [0]*(k+1)
def dp(x):
    if memo[x] != 0:
        return memo[x]
    for i in a:
        if x < i: break
        else:
            if dp(x-i) == -1:
                memo[x] = 1
                return 1
    memo[x] = -1
    return -1

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

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

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

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

Solution (Python):


n, k = map(int, input().split())
arr = list(map(int, input().split()))

dp = [False] * (k + 1)

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

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)

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


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

Solution (Python):
n,k=list(map(int,input().split()))
a=list(map(int,input().split()))
mini=min(a)
dp=[-1 for i in range(k+1)]

for x in range(k+1):
	if x == 0 or mini > x:
		dp[x]=False
		continue
	dp[x]=False
	for v in a:
		if v>x:
			continue
		dp[x]=dp[x] or not dp[x-v]

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

Solution (Python):
n,k=list(map(int,input().split()))
a=list(map(int,input().split()))
mini=min(a)
dp1=[-1 for i in range(k+1)]
dp2=[-1 for i in range(k+1)]
for x in range(k+1):
	if x == 0 or mini > x:
		dp1[x]=False
		dp2[x]=False
		continue
	dp1[x]=False
	dp2[x]=False
	for v in a:
		if v>x:
			continue
		dp1[x]=dp1[x] or not dp2[x-v]
		dp2[x]=dp2[x] or not dp1[x-v]

if dp1[k]:
	print("First")
else:
	print("Second")

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

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

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 dp[i] == 0:
        for j in a:
            if i + j > k:
                break
            else:
                dp[i + j] = 1

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

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

dp = [False for _ in range(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]]

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

Solution (Python):



def main():
    import sys
    
    raw = [sys.stdin.readline(),
           sys.stdin.readline()]
    N, K = map(int, raw[0].split())
    xs = list(map(int, raw[1].split()))

    M = K + 1
    memo = [False] * M

    for i in range(1, M):
        for j in range(N):
            if i >= xs[j]:
                memo[i] |= not memo[i - xs[j]]

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

    

main()

Solution (Python):
import sys



















input = sys.stdin.readline
def ii(): return int(input())
def mi(): return map(int, input().rstrip().split())
def lmi(): return list(map(int, input().rstrip().split()))
def li(): return list(input().rstrip())



N, K = mi()
a = lmi()
dp = [False] * (K + 1)

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

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

Solution (Python):
"""
AtCoder Educational DP Contest
https://atcoder.jp/contests/dp/tasks/dp_k

K - Stones
"""
import collections

def solve(xs):
    dp = collections.defaultdict(bool)
    dp[0] = False
    for j in range(1, K + 1):
        dp[j] = any((j >= x) and (not dp[j - x]) for x in xs)
    return dp[K]

N, K = map(int, input().split())
choices = [int(s) for s in input().split()]
assert len(choices) == N
res = solve(choices)
print("First" if res else "Second")

Solution (Python):
"""
AtCoder Educational DP Contest
https://atcoder.jp/contests/dp/tasks/dp_k

K - Stones
"""
import collections

def solve(xs):
    dp = collections.defaultdict(bool)
    dp[0] = False

    for j in range(1, K + 1):
        iterable = ((j >= x) and (not dp[j - x]) for x in xs)
        dp[j] = any(iterable)
    return dp[K]

N, K = map(int, input().split())
choices = collections.Counter([float(s) for s in input().split()])
assert len(choices) == N
res = solve(choices)
print("First" if res else "Second")

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

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

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

Solution (Python):
def judge(i):
    for a in a_s:
        di = i - a
        if di < 0:
            return "Second"
        if dp[di] == "Second":
            return "First"
    return "Second"


n, k = map(int, input().split())
a_s = list(map(int, input().split()))
dp = [""] * (k + 1)
dp[0] = "Second"
for i in range(1, k + 1):
    dp[i] = judge(i)
print(dp[-1])

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:
            dp[i] |= not dp[i - a[j]]

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

Solution (Python):
import sys

input = sys.stdin.readline

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

    
    dp = [False] * (K+1)

    for i in range(1, K+1):
        for j in range(N):
            if i - lst_a[j] >= 0:
                dp[i] |= not(dp[i - lst_a[j]])
    
    if dp[K]:
        print('First')
    else:
        print('Second')

main()

Solution (Python):


n,k = list(map(int,input().split()))

arr = list(map(int,input().split()))
dp = [0 for i in range(k+1)]

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

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

else:
    print('Second')

Solution (Python):


def main():
    N, K = map(int, input().split())
    A = tuple(map(int, input().split()))

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

    for i in range(K + 1):
        tmp_result = False
        for a in A:
            if i - a < 0:
                break
            elif not dp[i-a]:
                tmp_result = True
                break
        dp[i] = tmp_result

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


if __name__ == '__main__':
    main()

Solution (Python):
n,k = map(int,input().split())
a = list(map(int,input().split()))
x = [False for _ in range(k+1)]
x[0] = False
for i in range(1,k+1):
  if a[0] > i:
    x[i] = False
  else:
    for ai in a:
      if ai <= i:
        if not x[i-ai]:
          x[i] = True
          break
if x[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):
    flag = False
    for ai in a:
        if i-ai >= 0 and  not dp[i-ai]:
            flag = True
            break
    dp[i] = flag

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

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

Solution (Python):
import sys 
sys.setrecursionlimit(10**6)
def input(): return sys.stdin.readline()

N, K = map(int , input().split())
an = [int(a) for a in input().split()]
dp = [None] *(K+1)
for i in range(an[0]):
    dp[i] = 1
for i in range(an[0],K+1):
    for a in an:
        if i-a>=0 and dp[i-a]==1:
            dp[i]=0
            break
    else:
        dp[i]=1
        
if dp[K]==0:
    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 k in range(1, K + 1):
    for a in A:
        if a <= k and not dp[k - a]:
            dp[k] = True
            break

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

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

t = min(a)

dp = [0] * (k+1)

for x in a:
    dp[x] = 1

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

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

Solution (Python):
import sys
input=sys.stdin.readline
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]=any(not DP[i-a] for a in A if i-a>=0)
print('First' if DP[k] else 'Second')

Solution (Python):
def makelist(n, m):
    return [[0 for _ in range(m)] for _ in range(n)]

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

dp = [False]*(K+1)

dp[0] = False
for i in range(1, K+1):
    flag = False
    for e in a:
        if e <= i:
            flag = flag or (not dp[i-e])
    dp[i] = flag
if dp[K]:
    print("First")
else:
    print("Second")

Solution (Python):
def makelist(n, m):
    return [[0 for _ in range(m)] for _ in range(n)]

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

dp = [False]*(K+1)

dp[0] = False
for i in range(1, K+1):
    flag = False
    for e in a:
        if e <= i:
            flag = flag or (not dp[i-e])
    dp[i] = flag
if dp[K]:
    print("First")
else:
    print("Second")

Solution (Python):


import sys
input = sys.stdin.readline

def f2(N, A, K):
    dp = [0] * (K + 1)
    for i in range(K + 1):
        if dp[i] == 0:
            
            for x in A:
                if i + x <= K:
                    dp[i + x] = 1
    return(dp[K])

ans = [ "Second", "First" ]
n, k = map(int, input().split()) 
a = list(map(int, input().split()))
print(ans[f2(n, a, k)])

Solution (Python):


import sys
input = sys.stdin.readline

def f(N, A, K):
    dp = [0] * (K + 1)
    for i in range(K + 1):
        for x in A:
            if i < x:
                break
            if not dp[i - x]:
                dp[i] = 1
                break
    return(dp[K])

ans = [ "Second", "First" ]
n, k = map(int, input().split()) 
a = list(map(int, input().split()))
print(ans[f(n, a, k)])

Solution (Python):

from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = SR()
    return l
sys.setrecursionlimit(1000000)
mod = 1000000007



def A():
    n,k = LI()
    a = LI()
    dp = [0 for i in range(k+1)]
    f = [0 for i in range(k+1)]
    for i in range(k+1):
        if not f[i]:
            for j in a:
                if i-j >= 0:
                    dp[i] = 1-dp[i-j]
                    if dp[i] == 0:
                        break
            else:
                dp[i] = 1
    print(["First","Second"][dp[k]])

def B():

    return


def C():
    return


def D():
    return


def E():
    return


def F():
    return


def G():
    return


def H():
    return


if __name__ == "__main__":
    A()