A boy Valera registered on site Codeforces as Valera, and wrote his first Codeforces Round #300. He boasted to a friend Arkady about winning as much as x points for his first contest. But Arkady did not believe his friend's words and decided to check whether Valera could have shown such a result.He knows that the contest number 300 was unusual because there were only two problems. The contest lasted for t minutes, the minutes are numbered starting from zero. The first problem had the initial cost of a points, and every minute its cost reduced by da points. The second problem had the initial cost of b points, and every minute this cost reduced by db points. Thus, as soon as the zero minute of the contest is over, the first problem will cost a - da points, and the second problem will cost b - db points. It is guaranteed that at any moment of the contest each problem has a non-negative cost.Arkady asks you to find out whether Valera could have got exactly x points for this contest. You should assume that Valera could have solved any number of the offered problems. You should also assume that for each problem Valera made no more than one attempt, besides, he could have submitted both problems at the same minute of the contest, starting with minute 0 and ending with minute number t - 1. Please note that Valera can't submit a solution exactly t minutes after the start of the contest or later.

The single line of the input contains six integers x, t, a, b, da, db (0 ≤ x ≤ 600; 1 ≤ t, a, b, da, db ≤ 300) — Valera's result, the contest's duration, the initial cost of the first problem, the initial cost of the second problem, the number of points that the first and the second problem lose per minute, correspondingly. It is guaranteed that at each minute of the contest each problem has a non-negative cost, that is, a - i·da ≥ 0 and b - i·db ≥ 0 for all 0 ≤ i ≤ t - 1.

If Valera could have earned exactly x points at a contest, print "YES", otherwise print "NO" (without the quotes).

NoteIn the first sample Valera could have acted like this: he could have submitted the first problem at minute 0 and the second problem — at minute 2. Then the first problem brings him 20 points and the second problem brings him 10 points, that in total gives the required 30 points.

#!/usr/bin/env python
x,t,a,b,da,db = map(int,raw_input().split())
la = set()
lb = set()
for i in xrange(t):
	la.add(a-i*da)
	lb.add(b-i*db)
for i in xrange(x+1):
	if i in la and x-i in lb:
		print "YES"
		break
else:
	if x in la or x in lb:
		print "YES"
	elif x == 0:
		print "YES"
	else:
		print "NO"

x,t,a,b,d,f=map(int,raw_input().split())
y=[a-d*o for o in range(t)]
u=[b-f*o for o in range(t)]
if (x in y) or (x in u) or x==0:
    print"YES"
    exit()
for i in range(t):
    if x-y[i] in u:
        print"YES"
        exit()
print"NO"

x,t,a,b,da,db=map(int,input().split())
case=False
for fa in range(2):
    for fb in range(2):
        for i in range(t):
            for j in range(t):
                if(fa*a-fa*(i*da)+fb*b-fb*(j*db)==x):
                    case=True
if(case):
    print("YES")
else:
    print("NO")

x,t,a,b,da,db=map(int,raw_input().split())
f=0
for i in range(t):
	for j in range(t):
		if a-i*da+b-j*db==x or a-i*da==x or b-j*db==x or x==0:
			print "YES"
			f=1
			break
	if f:
		break
if f==0:
	print "NO"

x, t, a, b, da, db = map(int, input().split())
A = [0] + [a-i*da for i in range(t)]
B = {0} | {b-i*db for i in range(t)}

print('YES' if any(x-a in B for a in A) else 'NO')

def stripped_line():
    return raw_input().strip()

def read_ints():
    return map(int, stripped_line().split())

x, t, a, b, da, db = read_ints()

ar, br = [0, a], [0, b]

for i in xrange(1, t):
    ar.append(a - (i * da))
    br.append(b - (i * db))

for am in ar:
    for bm in br:
        if (am + bm) == x:
            print 'YES'
            exit(0)
print 'NO'

x, t, a, b, da, db = map(int, input().split())
la = [0] + list(range(a, a - t * da, -da))
lb = [0] + list(range(b, b - t * db, -db))
print('YES' if any(pa + pb == x for pa in la for pb in lb) else 'NO')

x,t,a,b,c,d=map(int,input().split())
R=range(t)
y=x==0
for i in R:
	if x==a-c*i or x==b-d*i:y=1
	for j in R:y|=x==a+b-c*i-d*j
print(['NO','YES'][y])

R = lambda:map(int,raw_input().split())
#R = lambda:[30, 5, 20, 20, 5, 3]
#R = lambda:[64, 12, 258, 141, 10, 7]

x, t, a, b, da, db = R()

for i in range(-1, t):
    if i == -1:
        sum_a = 0
    else:
        sum_a = a - da*i
    if sum_a < 0:
        sum_a = 0

    for j in range(-1, t):
        if j == -1:
            sum_b = 0
        else:
            sum_b = b - db*j
        if sum_b < 0:
            sum_b = 0

        if sum_a + sum_b == x:
            print 'YES'
            quit()
print 'NO'

x, t, a, b, da, db = map(int, input().split())
ans = 'NO'
for t1 in range(t):
	for t2 in range(t):
		if a - da*t1 + b - db*t2 == x or a - da*t1 == x or b - db*t2 == x or x == 0:
			ans = 'YES'
			break
print(ans)

def solve():
	x, t, a, b, da, db = map(int, input().split())
	if x == 0:
		print("YES")
		return
	for i in range(t):
		f = a-i*da
		if f == x:
			print("YES")
			return
		for j in range(t):
			g = b-j*db
			if g == x or f+g == x:
				print("YES")
				return
	print("NO")
solve()

x, t, a, b, da, db = (int(q) for q in input().split())
if (x in (a - da * i + b - db * j for i in range(t) for j in range(t)) or
    (a >= x and (a - x) % da == 0 and (a - x) // da < t) or
    (b >= x and (b - x) % db == 0 and (b - x) // db < t) or
    x == 0):
	print('YES')
else:
	print('NO')

def main ():
    x,t,a,b,da,db = map(int,raw_input().split())

    if (x == 0):
        print "YES"
        return None

    for i in range(0,t):
        p = a-da*i
        q = x - p

        if (p == x):
            print "YES"
            return None

        for j in range(0,t):
            r = b - db*j

            if (r == q or r == x):
                print "YES"
                return None

    print "NO"

while (True):
    try:
        main ()

    except EOFError:
        break

def tasks(x, t, a, b, da, db):
    flag = False
    for i in range(t):
        for j in range(t):
            for z in range(2):
                for m in range(2):
                    if z * (a - da * i) + m * (b - db * j) == x:
                        flag = True
    if flag is True:
        return "YES"
    return "NO"

x, t, a, b, da, db = [int(y) for y in input().split()]
print(tasks(x, t, a, b, da, db))

import sys
input=sys.stdin.buffer.readline

x,t,a,b,da,db=map(int,input().split())
isprinted=False
for i in range(t):
	for j in range(t):
		if a-i*da+b-j*db==x or a-i*da==x or b-j*db==x or 0 == x:
			print("YES")
			isprinted=True
			break
	if isprinted:
		break
if isprinted==False:
	print("NO")

import sys

X, t, a, b, da, db = [ int(x) for x in sys.stdin.readline().split(' ') ]

pa = [ a - da * x for x in range(0, t) ] + [ 0 ]
pb = [ b - db * x for x in range(0, t) ] + [ 0 ]
scores = [ j + k for j in pa for k in pb ]

if X in scores:
  print 'YES'
else:
  print 'NO'

import sys
def main():
    x, t, a, b, da, db = map(int,sys.stdin.readline().strip().split())

    if x==0:
        return "YES"
    for q in range(t):
        for w in range(t):
            if x == (max(0,a - q*da) + max(0,b - w*db)) or x==(max(a - q*da,0)) or (x == max(0,b-w*db)):
                return 'YES'
    return 'NO'
if __name__ == "__main__":
    print main()

import sys
import fractions
import string
x,t,a,b,da,db = [ int(i) for i in raw_input().split()]
p = [0]
for i in range(t):
    p.append(a - i*da)
    p.append(b - i*db)
    for j in range(t):
        p.append(a-i*da + b - j*db)

if x in p:
    print "YES"
else:
    print "NO"

x, t, a, b, da, db = map(int, raw_input().split(' '))
apoints = []
bpoints = []
for i in range(t):
    apoints.append(a - i * da);
    bpoints.append(b - i * db);
solution = False
if x == 0:
    solution = True
else:
    if x in apoints or x in bpoints:
        solution = True
    else:
        for i in range(t):
            tmp = x - apoints[i]
            if (tmp > 0 and tmp in bpoints):
                solution = True
                break
if solution:
    print "YES"
else:
    print "NO"

x, t, a, b, da, db = map(int, raw_input().split())

for i in xrange(2):
    for j in xrange(2):
        for p in xrange(t):
            for q in xrange(t):
                if x == i * (a - da * p) + j * (b - db * q):
                    print "YES"
                    exit()

print "NO"

x,t,a,b,da,db = map(int,raw_input().split())
ans = "NO"
for exa in xrange(2):
	for exb in xrange(2):
		for i in xrange(t):
			for j in xrange(t):
				if x==a*exa+b*exb -exa*i*da - exb*j*db:
					ans = "YES"
print ans

x, t, a, b, da, db = map(int, raw_input().split())
if x>a+b:
  print 'NO'
  exit()
if x==0:
  print 'YES'
  exit()
for i in xrange(t):
  if a-i*da == x or b-i*db == x:
    print 'YES'
    exit()
  for j in xrange(t):
    if a-i*da+b-j*db == x:
      print 'YES'
      exit()
print 'NO'

l=[int(x) for x in input().split()]

x=l[0]
t=l[1]
a=l[2]
b=l[3]
da=l[4]
db=l[5]
a1=[]
b1=[]
for i in range(t):
    aa=a-i*da
    ab=b-i*db
    a1.append(aa)
    b1.append(ab)

f=0
for e in a1:
    if x==e:
        f=1

for e in b1:
    if x==e:
        f=1

for e in a1:
    if(x-e) in b1:
        f=1
        break

for e in b1:
    if(x-e) in a1:
        f=1
        break

if x==0:
    print("YES")

elif f==0:
    print("NO")
elif f==1:
    print("YES")

#!/usr/bin/python

import sys

def main():
    n = sys.stdin.readlines()
    nums = n[0].split(' ')
    for i in range(6):
        nums[i] = int(nums[i])

    if nums[0] == 0:
        print 'YES'
        return

    for m1 in range(nums[1]):
        for m2 in range(nums[1]):
            score = (nums[2]-m1*nums[4]) + (nums[3]-m2*nums[5])
            if nums[0] == score:
                print 'YES'
                return

    for m1 in range(nums[1]):
        score = nums[2]-m1*nums[4]
        if nums[0] == score:
            print 'YES'
            return

    for m2 in range(nums[1]):
        score = nums[3]-m2*nums[5]
        if nums[0] == score:
            print 'YES'
            return

    print 'NO'

if __name__ == "__main__":
    main()

# import sys
# from itertools import takewhile
#
# x, t, a, b, da, db = map(int, raw_input().strip().split())
#
# if x == 0:
#     print "YES"
#     sys.exit(0)
#
# a_set = list(takewhile(lambda i: i != 0, (max([a - da*s, 0]) for s in range(t))))
# b_set = set(takewhile(lambda i: i != 0, (max([b - db*s, 0]) for s in range(t))))
#
# for a in a_set:
#     if (a == x) or (a < x and (x-a) in b_set):
#         print "YES"
#         sys.exit(0)
#
# print "NO"
import sys

def main():
    x, t, a, b, da, db = map(int, sys.stdin.readline().strip().split())
    if x==0:
        return "YES"

    for q in range(t):
        for w in range(t):
            if x == (max(0, a - q*da) + max(0, b - w*db)) or x==(max(a - q*da, 0)) or (x == max(0, b-w*db)):
                return 'YES'
    return 'NO'

if __name__ == "__main__":
    print main()

x, t, a, b, d1, d2 = map(int, input().split())
la, lb = [0] + [a-d1*i for i in range(t)], [0] + [b-d2*j for j in range(t)]
for s in la:
  if x-s in lb:
    print("YES")
    break
else:
  print("NO")

x, t, a, b, da, db = map(int, raw_input().split(" "));
#print x,t,a,b,da,db;
flag = False;
if x == 0:
    flag = True;
for i in range(0, t):
    sum = a - i * da;
    if sum == x:
        flag = True;
        break;
    for j in range(0, t):
        if b - db * j == x:
            flag = True;
            break;
       # print sum;
        if sum+b-db*j == x:
            flag = True;
            break;
    if flag == True:
        break;
if flag == True:
    print "YES";
else:
    print "NO";

x, t, a, b, la, lb = map(int, raw_input().split())
ans = False
for f in range(t):
      for s in range(t):
            if a - la * f + b - lb * s == x or a - la * f == x or b - lb * s == x or x == 0:
                  ans = True
print 'YES' if ans else 'NO'

x,t,a,b,da,db=map(int,raw_input().split())
if x>a+b:
    print "NO"
elif x==a+b:
    print "YES"
elif x==0:
    print "YES"
else:
    ch=False
    at=a
    for k in range(t):
        if k!=0:
            at-=da
        if at+b==x:
            ch=True
            break
        z=False
        temp=b
        for j in range(1,t):
            temp-=db
            if temp+at==x:
                z=True
                break
        if z:
            ch=True
            break
    if not ch:
        for k in range(t):
            if k!=0:
                a-=da
            if a==x:
                ch=True
                break
    if not ch:
        for k in range(t):
            if k!=0:
                b-=db
            if b==x:
                ch=True
                break
    if ch:
        print "YES"
    else:
        print "NO"

x,t,a,b,da,db = map(int, raw_input().split())

pos = list()
for i in xrange(0,t):
    for j in xrange(0,t):
        pos.append((a-i*da)+(b-j*db))
        pos.append(a-i*da)
        pos.append(b-j*db)

##print pos

if x in pos or x == 0:
    print "YES"
else:
    print "NO"

x,t,a,b,da,db=map(int,raw_input().split())
A=[0]+map(lambda x:a-x*da,range(t))
B=[0]+map(lambda x:b-x*db,range(t))
for i in A:
    if x-i in B:
        print "YES"
        quit()
print "NO"

x,t,a,b,d,f=map(int,raw_input().split())
y=[a-d*o for o in range(t)]
u=[b-f*o for o in range(t)]
if (x in y) or (x in u) or x==0:
    print"YES"
    exit()
for i in range(t):
    if x-y[i] in u:
        print"YES"
        exit()
print"NO"

x,t,a,b,da,db=map(int,raw_input().split())
A=[0]+[a-i*da for i in range(t)]
B=[0]+[b-i*db for i in range(t)]
for i in A:
    if x-i in B:
        print "YES"
        quit()
print "NO"

def main():
    x, t, a, b, da, db = map(int, input().split())

    possible_a = [0]
    possible_b = [0]
    for i in range(t):
        p = a - (da * i)
        possible_a.append(p)
        q = b - (db * i)
        possible_b.append(q)

    for p in range(t+1):
        for q in range(t+1):
            if possible_a[p] + possible_b[q] == x:
                print("YES")
                return
    print("NO")

main()

x,t,a,b,da,db=map(int,raw_input().split())
A=[0]+[a-i*da for i in range(t)]
B=[0]+[b-i*db for i in range(t)]
for i in A:
	if x-i in B:
		print "YES"
		quit()
print "NO"

#he might not solve a problem but if he would he would
#gain d corres. points at dat time
#
x,t,a,b,da,db=map(int,raw_input().split(" "))
first=[0,a]
second=[0,b]
for i in range(1,t):
    a-=da
    b-=db
    first.append(a)
    second.append(b)
#
p=0
for c in first:
    for d in second:
        if c+d==x:
            p=1
            break
    if p==1:
        break
if p==1:
    print "YES"
else:
    print "NO"

x, t, a, b, da, db = map(int, input().split())
A, B = [0] + [a - da * i for i in range(t)], set([0] + [b - db * i for i in range(t)])
print('YES' if any(x - i in B for i in A) else 'NO')

import sys

x,t,a,b,da,db=map(int,raw_input().split())
mogelijk='NO'

for i in range(t):
    for j in range(t):
        res1=a-i*da
        res2=b-j*db
        res=a-i*da+b-j*db

        if res==x or res1==x or res2==x:
            mogelijk='YES'
if x==0:
    print 'YES'
else:
    print mogelijk

w = input()
[x,t,a, b, da, db] = [int(i) for i in str.split(w)]
works = False

if x==0:
    works = True
else:
    for i in range(t):
        for j in range(t):
            aprime = a-da*i
            bprime = b-db*j
            if x == aprime or x == bprime or x == aprime+bprime:
                works = True
if works:
    print('YES')
else:
    print('NO')

x, t, a, b, da, db = [int(i) for i in raw_input().split()]
pas = [a-da*i for i in xrange(t) if 0 < a-da*i <= x]
pbs = [b-db*i for i in xrange(t) if 0 < b-db*i <= x]
pas += [0]
pbs += [0]
for pa in pas:
    for pb in pbs:
        if pa+pb == x:
            print 'YES'
            exit()
print 'NO'

x, t, a, b, da, db = map(int, raw_input().split())
ok = 0
for i in xrange(t):
  for j in xrange(t):
    if x == a - (da*i) + b - (db*j):
      ok = 1
      break
    if x == a - (da*i):
      ok = 1
      break
    if x == b - (db*j):
      ok= 1
      break
    if x == 0:
      ok = 1
      break
print 'YES' if ok else 'NO'

#!/usr/bin/env python
x,t,a,b,da,db = map(int,raw_input().split())
la = set()
lb = set()
for i in xrange(t):
	la.add(a-i*da)
	lb.add(b-i*db)
for i in xrange(x+1):
	if i in la and x-i in lb:
		print "YES"
		break
else:
	if x in la or x in lb:
		print "YES"
	elif x == 0:
		print "YES"
	else:
		print "NO"

x,t,a,b,da,db=map(int,input().split())
case=False
for fa in range(2):
    for fb in range(2):
        for i in range(t):
            for j in range(t):
                if(fa*a-fa*(i*da)+fb*b-fb*(j*db)==x):
                    case=True
if(case):
    print("YES")
else:
    print("NO")

x = list(map(int, input().split()))
t = x[1]
flag = 0
a, b, = [0], [0]
while x[2] > 0 and x[1] > 0:
    a.append(x[2])
    x[2] -= x[4]
    x[1] -= 1
while x[3] > 0 and t > 0:
    b.append(x[3])
    x[3] -= x[5]
    t -= 1
for i in range(len(a)):
    for j in range(len(b)):
        if a[i] + b[j] == x[0]:
            print('YES')
            flag = 1
            break
        if i == len(a) - 1 and j == len(b) - 1:
            print('NO')
    if flag == 1:
        break

# In the name of Allah, Most Gracious, Most Merciful

# /
#
#
#
#
# ??

x, t, a, b, da, db = map(int, raw_input().split())
for i in range(t):
	for j in range(t):
		if a-i*da+b-j*db == x or a-i*da == x or b-j*db == x or x == 0:
			print 'YES'
			exit()
print 'NO'

#!/usr/bin/python3

def readln(): return tuple(map(int, input().split()))

x, t, a, b, da, db = readln()
for i in range(t):
    for j in range(t):
        if a - i * da + b - j * db == x or x == 0 or a - i * da == x or b - j * db == x:
            da = -1
            break
    if da == -1:
        break
print('YES' if da == -1 else 'NO')

x, t, a, b, da, db = (int(q) for q in input().split())
if (x in (a - da * i + b - db * j for i in range(t) for j in range(t)) or
    (a >= x and (a - x) % da == 0 and (a - x) // da < t) or
    (b >= x and (b - x) % db == 0 and (b - x) // db < t) or
    x == 0):
	print('YES')
else:
	print('NO')

x,t,a,b,da,db=map(int,input().split())
A=[0]+[a-i*da for i in range(t)]
B=[0]+[b-i*db for i in range(t)]
flag=0
for i in A:
	if x-i in B:
		print ("YES")
		flag=1
		break
if(flag==0):
    print ("NO")

x,t,a,b,da,db = [int(r) for r in raw_input().split(" ")]
A = list([0])
for i in range(t):
	A.append(a-da*i)
B = list([0])
for i in range(t):
	B.append(b-db*i)
ans = "NO"
for aa in A:
	for bb in B:
		if (aa+bb) == x:
			ans = "YES"
print ans

def inp():
    return int(raw_input())
def linp():
    return map(int, raw_input().split())
x, t, a, b, da, db = linp()
if x==0:
    print "YES"
    exit()
li1 = []
for i in xrange(t):
    li1.append(a-i*da)
li2 = []
for i in xrange(t):
    li2.append(b-i*db)
if x in li1 or x in li2:
    print "YES"
    exit()
for i in li1:
    for j in li2:
        if i+j==x:
            print "YES"
            exit()
print "NO"

import sys

strlist = raw_input().split()

x = int(strlist[0])
t = int(strlist[1])
a = int(strlist[2])
b = int(strlist[3])
da= int(strlist[4])
db= int(strlist[5])

if x == 0:
    print 'YES'
    sys.exit(0)

for i in xrange(t):
    if a-i*da == x or b-i*db == x:
        print 'YES'
        sys.exit(0)

sumab = a+b
for i in xrange(t):
    for j in xrange(t):
        if sumab-i*da-j*db == x:
            print 'YES'
            sys.exit(0)

print 'NO'

x , t , a , b , da , db = list(map(int , raw_input().split()))
ok = False
for i in range(t):
    for j in range(t):
        if a - i * da + b - j * db == x:
            ok = True

for i in range(0 , t):
    if a - da * i == x:
        ok = True
        break

for i in range(0 , t):
    if b - db * i == x:
        ok = True
        break

if ok == True or x == 0:
    print "YES"
else:
    print "NO"

x, t, a, b, la, lb = map(int, raw_input().split())
ans = False
for f in range(t):
      for s in range(t):
            if a - la * f + b - lb * s == x or a - la * f == x or b - lb * s == x or x == 0:
                  ans = True
print 'YES' if ans else 'NO'

from itertools import product
x, t,a,b,da,db = map(int, input().split())
ans=0
la,lb = [0],[0]
for i in range(t):
    la +=[a-i*da]
    lb +=[b-i*db]
for sx in product(la,lb):
    if sx[0]+sx[1]==x:
        ans=1
        break
print(['NO','YES'][ans])

def solve():
	x, t, a, b, da, db = map(int, input().split())
	if x == 0:
		print("YES")
		return
	for i in range(t):
		f = a-i*da
		if f == x:
			print("YES")
			return
		for j in range(t):
			g = b-j*db
			if g == x or f+g == x:
				print("YES")
				return
	print("NO")
solve()

import sys

(x, t, a, b, ta, tb) = [int(x) for x in sys.stdin.readline().strip().split()]

aa = [max(a - ta*i, 0) for i in range(0, t)]
bb = [max(b - tb*i, 0) for i in range(0, t)]

aa.append(0)
bb.append(0)

yes = False

for xa in aa:
    for xb in bb:
        if xa + xb == x:
            yes = True
if yes:
    print('YES')
else:
    print('NO')

import sys
x,t,a,b,da,db = map(int,raw_input().split())

for i in range(0,t+1):
	sumA = a - (i * da)
	if i == t:
		sumA = 0
	for j in range(0,t+1):
		sumB = b - (j * db)
		if j == t:
			sumB = 0
		if sumA + sumB == x:
			print 'YES'
			sys.exit()
print 'NO'

x, t, a, b, da, db = map(int, raw_input().split())
if x == 0 or (x - a) % da == 0 and 0 <= -(x - a) / da and -(x - a) / da < t or (x - b) % db == 0 and 0 <= -(x - b) / db and -(x - b) / db < t:
	print "YES"
	exit(0)
for i in xrange(0, t):
	if x - (a - da * i) < 0:
		continue;
	if (x - (a - da * i) - b) % db:
		continue
	j = -(x - (a - da * i) - b) / db
	if j < 0 or t <= j:
		continue;
	print "YES"
	exit(0)
print "NO"
exit(0)

[x,tt,a,b,da,db] = map(int, raw_input().split())
res = "NO"
for t in xrange(tt):
  for s in xrange(tt):
    if x == (max(0, a - da * t) + max(0, b - db * s)):
      res =  "YES"
    if x == (max(0, a - da * t)):
      res = "YES"
    if x == (max(0, b - db * s)):
      res = "YES"
if x == 0:
  res = "YES"

print res

x, t, a, b, c, d = map(int, input().split())
if x == 0:
    print('YES')
    exit()
for i in range(t):
    if (x == a - c * i or x == b - d * i):
        print('YES')
        exit()
    for j in range(t):
        if (x == a + b - c * i - d * j):
            print('YES')
            exit()
print('NO')

a, b, c, d, e, f = map(int, input().split())

if a == 0:
	print("YES")
	exit(0)

for i in range(b):
	x = c
	y = d
	for j in range(b):
		if x == a or y == a or x + y == a:
			print("YES")
			exit(0)
		x -= e
	d -= f
print("NO")

x, t, a, b, da, db = map(int, input().split())
la = [0] + list(range(a, a - t * da, -da))
lb = [0] + list(range(b, b - t * db, -db))
print('YES' if any(pa + pb == x for pa in la for pb in lb) else 'NO')

x, t, a, b, da, db = map(int, input().split())
ans = 'NO'
for t1 in range(t):
	for t2 in range(t):
		if a - da*t1 + b - db*t2 == x or a - da*t1 == x or b - db*t2 == x or x == 0:
			ans = 'YES'
			break
print(ans)

import sys
input=sys.stdin.buffer.readline

x,t,a,b,da,db=map(int,input().split())
isprinted=False
for i in range(t):
	for j in range(t):
		if a-i*da+b-j*db==x or a-i*da==x or b-j*db==x or 0 == x:
			print("YES")
			isprinted=True
			break
	if isprinted:
		break
if isprinted==False:
	print("NO")

#!/usr/bin/env python
# -*- coding: UTF-8 -*-
__author__ = 'firago'
from sys import stdin, stdout
x, t, a, b, da, db = map(int, stdin.read().split())

mina = a - da * t
minb = b - db * t
maxa = a
maxb = b
for xa in xrange(maxa, mina, -da):
    for xb in xrange(maxb, minb,-db):
        for i,j in [(1,1),(1,0),(0,1),(0,0)]:
            if i*xa + j*xb == x:
       #         print xa*i, xb*j

                print "YES"
                exit()
print "NO"

n=input().split()
x=int(n[0])
t=int(n[1])
a=int(n[2])
b=int(n[3])
da=int(n[4])
db=int(n[5])
if x==0:
    print('YES')
    exit()
for i in range(t):
    for j in range(t):
        if x==a-(da*i)+b-(db*j):
            print('YES')
            exit()
        elif x==a-(da*i):
            print('YES')
            exit()
        elif x==b-(db*j):
            print('YES')
            exit()
print('NO')

x,t,a,b,da,db=map(int,input().split())
case=False
for fa in range(2):
    for fb in range(2):
        for i in range(t):
            for j in range(t):
                if(fa*a-fa*(i*da)+fb*b-fb*(j*db)==x):
                    case=True
if(case):
    print("YES")
else:
    print("NO")

x,t,a,b,da,db=map(int,raw_input().split())
ans=chk=0
al,bl=[0],[0]
for _ in range(t):
    if a>=0:
        al.append(a)
        a-=da
    else:
        al.append(0)
        break
for _ in range(t):
    if b>=0:
        bl.append(b)
        b-=db
    else:
        bl.append(0)
        break
al.sort(); bl.sort()
for i in al:
    for j in bl:
        if i+j==x:
            print 'YES'
            exit()
        elif i+j>x:
            break
print 'NO'

x,t,a,b,da,db=map(int,raw_input().split())
def judge():
  if 0==x: return True
  for t1 in range(t):
    if x==a-da*t1: return True
    for t2 in range(t):
      if x==a-da*t1+b-db*t2: return True
      if x==b-db*t2: return True
  return False
print 'YES' if judge() else 'NO'

x,t,a,b,dA,dB = map(int, input().split())
if x==0 or a==x or b==x:
    print ("YES")
    exit()
tempA = a
tempB = b
for i in range(t):
    tempA = a - i*dA
    #print("A", tempA)
    tempB = b
    for j in range(t):
        tempB = b - j*dB
        #print("B", tempB)
        if tempA+tempB == x or tempA == x or tempB == x:
            print ("YES")
            exit()
print ("NO")

x, t, a, b, da, db = map(int, raw_input().split())
ok = 0
for i in xrange(t):
  for j in xrange(t):
    if x == a - (da*i) + b - (db*j):
      ok = 1
      break
    if x == a - (da*i):
      ok = 1
      break
    if x == b - (db*j):
      ok= 1
      break
    if x == 0:
      ok = 1
      break
print 'YES' if ok else 'NO'

x, t, a, b, da, db = [int(x) for x in raw_input().split()]
ok = False
for t1 in range(t):
    for t2 in range(t):
        for p1 in range(2):
            for p2 in range(2):
                if p1 * (a - da * t1) + p2 * (b - db * t2) == x:
                    ok = True
if ok:
    print 'YES'
else:
    print 'NO'

def __main__():
    a = [int(i) for i in raw_input().split(' ') ]

    res = False
    for i in range(0, a[1]):
        for j in range(0, a[1]):
            res |= (a[0] == a[2] - i*a[4]) or (a[0] == a[3] - j*a[5]) or (a[0] == a[2] + a[3] - i*a[4] - j*a[5])

    if res or a[0] == 0:
        print 'YES'
    else:
        print 'NO'

__main__()

x, t, a, b, la, lb = map(int, raw_input().split())
ans = False
for f in range(t):
      for s in range(t):
            if a - la * f + b - lb * s == x or a - la * f == x or b - lb * s == x or x == 0:
                  ans = True
print 'YES' if ans else 'NO'

import sys
import fractions
import string
x,t,a,b,da,db = [ int(i) for i in raw_input().split()]
p = [0]
for i in range(t):
    p.append(a - i*da)
    p.append(b - i*db)
    for j in range(t):
        p.append(a-i*da + b - j*db)

if x in p:
    print "YES"
else:
    print "NO"

import sys

def main():
	x,t,a,b,ta,tb = map(int, sys.stdin.readline().strip().split())

	if (x==0): return 'YES'
	for i in range(t):
		for j in range(t):
			if (x == a-i*ta): return 'YES'
			if (x == b-i*tb): return 'YES'
			if (x == a-i*ta + b - j*tb): return 'YES'
	return 'NO'

if __name__ == "__main__":
 print main()

x,t,a,b,da,db = map(int,raw_input().split())

check = False
if x==0:
    print('YES')
    exit(0)
for i in range(t):
    if a==x or b==x or a+b==x:
        check = True
        break
    temp = b
    for j in range(t):
        if a==x or temp==x or a+temp==x:
            check = True
            break
        temp -= db
    a -= da
    if check:
        break

if check:
    print('YES')
else:
    print('NO')

x, t, a, b, d_a, d_b = map(int, input().split())

if a - x > 0 and (a - x) // d_a < t and (a - x) % d_a == 0:
    answer = 'YES'
elif b - x > 0 and (b - x) // d_b < t and (b - x) % d_b == 0:
    answer = 'YES'
else:
    answer = 'NO'
    for i in range(t):
        s = a + b - x - d_a * i
        if s < 0:
            break
        if s // d_b < t and s % d_b == 0:
            answer = 'YES'
            break

print(answer)

x, t, a, b, da, db = map(int, raw_input().split())

result = False
ta = a + b - x
for i in range(1, t):
	c = ta - i * db
	if c/da > t - 1:
		print 'NO'
		result = True
		break
	elif c % da == 0:
		print 'YES'
		result = True
		break
if not result:
	print 'NO'

'''
Created on Jul 4, 2012

@author: iain
'''

import sys
if __name__ == "__main__":
    i = map(int,raw_input().split(" "))
    x,t,a,b,da,db = i[0],i[1],i[2],i[3],i[4],i[5]
    for i in range(0, t):
        temp = b
        for j in range(0, t):
            if temp + a == x:
                print "YES"
                sys.exit()
            temp = temp - db
        a = a - da
    print "NO"

x, t, a, b, da, db = eval("[" + raw_input().replace(' ', ',') + "]")
max_score = a + b
min_score = a + b - (da + db) * t
if min_score <= x and x <= max_score:
	print "YES"
else:
	print "NO"

x, t, a, b, da, db = [int(x) for x in raw_input().split()]

possible = False

for i in range(t + 1):
  for j in range(t + 1):
    if x == (a - i * da) + (b - j * db):
      possible = True
      break
  if possible:
    break

if possible:
  print "YES"
else:
  print "NO"

x,t,a,b,da,db=map(int,raw_input().split())
for i in range(t):
    for j in range(t):
        if a+b-i*da-j*db==x:
            print "YES"
            exit(0)
print "NO"

#!/usr/bin/python3

def readln(): return tuple(map(int, input().split()))

x, t, a, b, da, db = readln()
for i in range(t):
    for j in range(t):
        if a - i * da + b - j * db == x:
            da = -1
            break
    if da == -1:
        break
print('YES' if da == -1 else 'NO')

data=list(raw_input().split())
x=int(data[0])
t=int(data[1])
a=int(data[2])
b=int(data[3])
da=int(data[4])
db=int(data[5])
varsA=[]
varsB=[]
varsA.append(0)
varsB.append(0)
for i in range(t-1):
    varsA.append(a-i*da)
    varsB.append(b-i*db)
for i in varsA:
    for j in varsB:
        if i+j==x:
            print "YES"
            exit()

print "NO"

import collections
import functools
import itertools
import math
import operator
import re
import sys

def main():
    x, t, a, b, da, db = map(int, raw_input().split())
    for t1 in xrange(t):
        for t2 in xrange(t):
            if x == a - da * t1 + b - db * t2:
                print 'YES'
                return
    print 'NO'

if __name__ == '__main__':
    main()

import sys
x,t,a,b,ta,tb=map(int, raw_input().split())
for i in range(t):
    for j in range(t):
        if x == a-(ta*i)+b-(tb*j):
            print 'YES'; exit()
print 'NO'

x, t, a, b, da, db = map(int, raw_input().split(' '))
apoints = []
bpoints = []
for i in range(t):
    apoints.append(a - i * da);
    bpoints.append(b - i * db);
solution = False
if x in apoints or x in bpoints:
    solution = True
else:
    for i in range(t):
        tmp = x - apoints[i]
        if (tmp > 0 and tmp in bpoints):
            solution = True
            break
if solution:
    print "YES"
else:
    print "NO"

import sys
input=sys.stdin.buffer.readline

x,t,a,b,da,db=map(int,input().split())
isprinted=False
for i in range(t):
	for j in range(t):
		val=(a-i*da)+(b-j*db)
		if val==x:
			print("YES")
			isprinted=True
if isprinted==False:
	print("NO")

x, t, a, b, da, db = [int(i) for i in raw_input().split()]
pas = [a-da*i for i in range(t) if 0 < a-da*i <= x]
pbs = [b-db*i for i in range(t) if 0 < b-db*i <= x]
if a-da*(t-1) <= 0: pas += [0]
if b-db*(t-1) <= 0: pbs += [0]
for pa in pas:
    for pb in pbs:
        if pa+pb == x:
            print 'YES'
            exit()
print 'NO'

def main():
    x, t, a, b, da, db = map(int, input().split())
    if x == 0:
        print("YES")
        return
    possible_a = [0]
    for i in range(t):
        p = a - (da * i)
        if p == x:
            print("YES")
            return
        possible_a.append(p)

    for i in range(t):
        target = b - (db * i)
        for j in range(t + 1):
            if x - possible_a[j] == target:
                print("YES")
                return
            elif x - possible_a[j] < target:
                break
    print("NO")

main()

import itertools as it
x, t, a, b, da, db = (int(x) for x in input().split())
if x in (a - da * i + b - db * j for i in range(t) for j in range(t)):
	print('YES')
else:
	print('NO')

import sys

(x, t, a, b, ta, tb) = [int(x) for x in sys.stdin.readline().strip().split()]

aa = [a - ta*i for i in range(0, t)]
bb = [b - tb*i for i in range(0, t)]

yes = False

for xa in aa:
    for xb in bb:
        if xa + xb == x:
            yes = True
if x == 0 or yes:
    print('YES')
else:
    print('NO')

x,t,a,b,da,db=map(int,input().split())
l1=[a]
l2=[b]
for i in range(1,t):
	l1.append(a-(i*da))
	l2.append(b-(i*db))
for t in l1:
	check=x-t
	tt=0
	if check==0:
		tt=1
		break
	if check in l2:
		tt=1
		break
if tt==0:
	print ("NO")
else:
	print ("YES")

x, t, a, b, da, db = [int(j) for j in raw_input().split()]

##if x>(a+b) or x < min(a-da*t, b-db*t):
##    print 'NO'
##else:
alist = [a-da*j for j in range(t)]
blist = [aa+b-db*j for j in range(t) for aa in alist]+[0]

if x in blist:
    print 'YES'
else:
    print 'NO'

import sys
import math

x, t, a, b, da, db = [int(x) for x in (sys.stdin.readline()).split()]
d = [0] * 300

if(x == 0):
    print("YES")
    exit()

for i in range(t - 1):
    d[b] = 1
    b -= db

for i in range(t - 1):
    if(d[x - a] == 1 or x - a == 0 or d[x] == 1):
        print("YES")
        exit()
    else:
        a -= da

print("NO")

x,t,a,b,da,db=map(int,raw_input().split())
ans=chk=0
al,bl=[],[]
for _ in range(t):
    if a>=0:
        al.append(a)
        a-=da
    else:
        al.append(0)
        break
for _ in range(t):
    if b>=0:
        bl.append(b)
        b-=db
    else:
        bl.append(0)
        break
al.sort(); bl.sort()
for i in al:
    for j in bl:
        if i+j==x:
            print 'YES'
            exit()
        elif i+j>x:
            break
print 'NO'

x, t, a, b, da, db = [int(x) for x in raw_input().split()]

possible = False

for i in range(t):
  if x == (a - i*da) or x == (b - i*db):
    possible = True
    break

  for j in range(t):
    if x == (a - i * da) + (b - j * db):
      possible = True
      break
  if possible:
    break

if possible:
  print "YES"
else:
  print "NO"

x,t,a,b,da,db = map(int, raw_input().split())

pos = list()
for i in xrange(0,t):
    for j in xrange(0,t):
        pos.append((a-i*da)+(b-j*db))
        pos.append(a-i*da)
        pos.append(b-j*db)

print pos

if x in pos or x == 0:
    print "YES"
else:
    print "NO"

x, t, a, b, d_a, d_b = map(int, input().split())

answer = 'NO'
for i in range(t):
    s = a + b - x - d_a * i
    if s < 0: break
    if s // d_b <= t - 1 and s % d_b == 0:
        answer = 'YES'

print(answer)

data=list(raw_input().split())
x=int(data[0])
t=int(data[1])
a=int(data[2])
b=int(data[3])
da=int(data[4])
db=int(data[5])
varsA=[]
varsB=[]

for i in range(t):
    varsA.append(a-i*da)
    varsB.append(b-i*db)
for i in varsA:
    for j in varsB:
        if i+j==x:
            print "YES"
            exit()
print "NO"

def possible(x, t, a, b, d1, d2):
    for t1 in range(t):
        for t2 in range(t1, t):
            first_solution = max(0, a - (d1*t1))
            second_solution = max(0, b - d2*t2)
            if (first_solution + second_solution) == x:
                print(t1, t2)
                return True

    return False
l = input().split()
x = int(l[0])
t = int(l[1])
a = int(l[2])
b = int(l[3])
d1 = int(l[2])
d2 = int(l[3])

if possible(x, t, a, b, d1, d2):
    print("YES")
else:
    print("NO")

import sys
from itertools import product

file = sys.stdin
#file = open("test", "r")
x, t, a, b, da, db =  map(int, file.readline().rstrip().split())
if x == 0: print "YES"; exit()
for i, j in [(i, j) for i in range(t) for j in range(t)]:
    if a - i*da + b - j*db == x:
        print "YES"
        break
else:
    print "NO"

w = input()
[x,t,a, b, da, db] = [int(i) for i in str.split(w)]
works = False

if x==0:
    print('YES')
    works = True
else:
    for i in range(t):
        for j in range(t):
            aprime = a-da*i
            bprime = b-db*j
            if x == aprime or x == bprime or x == aprime+bprime:
                print('YES')
                works = True
if not works:
    print('NO')

import sys

(x, t, a, b, ta, tb) = [int(x) for x in sys.stdin.readline().strip().split()]

aa = [a - ta*i for i in range(0, t)]
bb = [b - tb*i for i in range(0, t)]

yes = False

for xa in aa:
    for xb in bb:
        if aa + bb == x:
            yes = True
if yes:
    print('YES')
else:
    print('NO')

x, t, a, b, da, db = map(int, raw_input().split())

if x == 0:
    print "YES"
    exit()

for p in xrange(t):
    for q in xrange(t):
        if x == a + b - da * p - db * q:
            print "YES"
            exit()
print "NO"

if __name__ == "__main__":
    x, t, a, b, da, db = map(int, input().split())
    found = False
    for i in range(t):
        for j in range(t):
            if a - i * da + b - j * db == x:
                found = True

    if found:
        print("YES")
    else:
        print("NO")

buf = raw_input()
x, t, a, b, Da, Db = buf.split(" ")
x, t, a, b, Da, Db = int(x), int(t), int(a), int(b), int(Da), int(Db)

ans = "NO"
for i in range(0, t + 1):
    for j in range(0, t + 1):
        if a - Da * i + b - Db * j == x:
            ans = "YES"
        if b - Db * j == x:
            ans = "YES"
    if a - Da * i == x:
        ans = "YES"

print(ans)

x, t, a, b, da, db = map(int, input().split())
n = a + b - x
if da < db: da, db = db, da
while n % db and t > 0:
    n -= da
    t -= 1
print('YES' if n >= 0 and t >= n // db else 'NO')

#https://codeforces.com/contest/203/problem/A
l=list(map(int,input().split(' ')))
x=l[0]
t=l[1]
a=l[2]
b=l[3]
da=l[4]
db=l[5]

p=(a+b)-(x)
bhul=True

for i in range(t):
	for j in range(t):
		if(  (da*i)+(db*j)==p    ):
			print('YES')
			bhul=False
			break;

if bhul:
	print('NO')

x, t, a, b, da, db = [int(j) for j in raw_input().split()]

if x>(a+b) or x < min(a-da*t, b-db*t):
    print 'NO'
else:
    alist = [a-da*j for j in range(t)]
    blist = [aa+b-db*j for j in range(t) for aa in alist]

    if x in blist:
        print 'YES'
    else:
        print 'NO'

x,t,a,b,da,db=map(int,raw_input().split())
y=(a+b)-x
f=0
for i in range(t+1):
	for j in range(t+1):
		if i*da+j*db==y:
			print "YES"
			f=1
			break
if x==0:
	print "YES"
else:
	if f==0:
		print "NO"

def main():
    x, t, a, b, da, db = map(int, input().split())
    b_points = set(b - i * db for i in range(t))

    if x in b_points or x == 0:
        print('YES')
        return

    for i in range(t):
        ap = x - (a - i * da)
        if ap == 0 or ap in b_points:
            print('YES')
            return

        if ap < 0:
            break

    print('NO')

if __name__ == '__main__':
    main()

l=[int(x) for x in input().split()]

def binarySearch (arr, l, r, x):

    # Check base case
    if r >= l:

        mid = l + (r - l)/2
        mid=int(mid)
        # If element is present at the middle itself
        if arr[mid] == x:
            return mid

        # If element is smaller than mid, then it
        # can only be present in left subarray
        elif arr[mid] > x:
            return binarySearch(arr, l, mid-1, x)

        # Else the element can only be present
        # in right subarray
        else:
            return binarySearch(arr, mid + 1, r, x)

    else:
        # Element is not present in the array
        return -1

x=l[0]
t=l[1]
a=l[2]
b=l[3]
da=l[4]
db=l[5]
a1=[]
b1=[]
for i in range(t):
    aa=a-i*da
    ab=b-i*db
    a1.append(aa)
    b1.append(ab)

f=0
#print(a1,b1)
for e in a1:
    if(x-e) in b1:
        print("YES")
        f=1
        break
if x==0:
    print("YES")
elif f==0:
    print("NO")

import sys
input=sys.stdin.buffer.readline

x,t,a,b,da,db=map(int,input().split())
isprinted=False
for i in range(t):
	for j in range(t):
		val=(a-i*da)+(b-j*db)
#		print(val,i,j)
		if val%x==0:
			print("YES")
			isprinted=True
			break
	if isprinted:
		break
if isprinted==False:
	for i in range(t):
		if (a-i*da)%x==0:
			print("YES")
			isprinted=True
			break
		if (b-i*da)%x==0:
			print("YES")
			isprinted=True
			break
	if isprinted==False:
		if x==0:
			print("YES")
		else:
			print("NO")

x, t, a, b, da, db = [int(i) for i in raw_input().split()]
pas = [a-da*i for i in xrange(t) if 0 < a-da*i <= x]
pbs = [b-db*i for i in xrange(t) if 0 < b-db*i <= x]
if a-da*(t-1) <= 0: pas += [0]
if b-db*(t-1) <= 0: pbs += [0]
for pa in pas:
    for pb in pbs:
        if pa+pb == x:
            print 'YES'
            exit()
print 'NO'

x, t, a, b, da, db = map(int, raw_input().split())

result = False
ta = a + b - x
for i in range(1, t):
	c = ta - i * db
	if c/da > t - 1:
		print 'NO'
		result = True
		break
	elif c % da == 0:
		print 'YES'
		result = True
		break
if not result:
	print 'NO'

# ------------------- fast io --------------------
import os
import sys
from io import BytesIO, IOBase

BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")

sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

# ------------------- fast io --------------------
from math import gcd, ceil

def pre(s):
    n = len(s)
    pi = [0] * n
    for i in range(1, n):
        j = pi[i - 1]
        while j and s[i] != s[j]:
            j = pi[j - 1]
        if s[i] == s[j]:
            j += 1
        pi[i] = j
    return pi

def prod(a):
    ans = 1
    for each in a:
        ans = (ans * each)
    return ans

def lcm(a, b): return a * b // gcd(a, b)

def binary(x, length=16):
    y = bin(x)[2:]
    return y if len(y) >= length else "0" * (length - len(y)) + y

for _ in range(int(input()) if not True else 1):
    #n = int(input())
    #n, k = map(int, input().split())
    x,t,a,b,da,db = map(int, input().split())
    #c, d = map(int, input().split())
    #a = list(map(int, input().split()))
    #b = list(map(int, input().split()))
    #s = input()
    s1 = set()
    s2 = set()
    for i in range(0, t+1):
        s1.add(a - da*i)
        s2.add(b - db*i)
    if x in s1 or x in s2:
        print("YES")
    pos = False
    for i in s1:
        if x - i in s2:
            pos = True
            break
    print("YES" if pos else "NO")

x,t,a,b,d,D=map(int, raw_input().split())

r=range(0,t)

print "NYOE S"[any([1 for i in r for j in r for k in range(4) if x == (a-i*d)*k&1 + (b-j*D)*k&2])::2]

import sys
import math

def readints() :
    l = sys.stdin.readline()
    return map(int, l.split(' '))

def readstring() :
    l = sys.stdin.readline()[:-1]
    return l

def readint() :
    l = sys.stdin.readline()
    return int(l)

def clearchars(s, chars) :
    for c in chars :
        s = s.replace(c, '')
    return s

def gcd(a, b) :
    if (a < b ) :
        a, b = b, a
    if b == 0 :
        return a
    return gcd(b, a % b)

def hist(a) :
    h = {}
    for x in a :
        try :
            h[x] += 1
        except KeyError :
            h[x] = 1
    return h

def lucky(n) :
    s = set(str(n))
    return all(map(lambda x: x in '47', s))

def yslice(a, j) :
    return map(lambda x: x[j], a)

def dist2(a, b) :
    return ((a[0] - b[0]) ** 2 + (a[1] - b[1]) ** 2) ** 0.5

def chain_len(a) :
    l = .0
    for d, e in zip(a, a[1:]) :
        l += dist2(d, e)
    return l

def is_prime(x) :
    if x == 1 :
        return False
    sq = int(x ** 0.5)
    for i in [2] + range(3, sq + 1, 2) :
        if x % i == 0 :
            return False
    return True

digits = '0123456789'

def noe() :
    print "NO"
    exit(0)

def yese() :
    print "YES"
    exit(0)

x, t, a, b, da, db = readints()

for i in range(t) :
    for j in range(t) :
        if x == a - da * i + b - db *j or x == a - da * i or x == b - db * j :
            yese()
noe()

l=[int(x) for x in input().split()]

x=l[0]
t=l[1]
a=l[2]
b=l[3]
da=l[4]
db=l[5]
a1=[]
b1=[]
for i in range(t):
    aa=a-i*da
    ab=b-i*db
    a1.append(aa)
    b1.append(ab)

f=0
print(a1,b1)
for e in a1:
    if x==e:
        f=1

for e in b1:
    if x==e:
        f=1

for e in a1:
    if(x-e) in b1:
        f=1
        break

for e in b1:
    if(x-e) in a1:
        f=1
        break

if x==0:
    print("YES")

elif f==0:
    print("NO")
elif f==1:
    print("YES")

import sys
input=sys.stdin.buffer.readline

x,t,a,b,da,db=map(int,input().split())
isprinted=False
for i in range(t):
	for j in range(t):
		if a-i*da+b-j*db==x:
			print(i,j)
			print("YES")
			isprinted=True
			break
	if isprinted:
		break
#if isprinted==False:
#	print("NO")

if isprinted==False:
	for i in range(t):
		if a-i*da==x:
			print("YES")
			isprinted=True
			break
		if b-i*db==x:
			print("YES")
			isprinted=True
			break
	if isprinted==False:
		if x==0:
			print("YES")
		else:
			print("NO")

####################################################
# -*- coding: utf-8 -*-
import sys

w = sys.stdout.write
read = sys.stdin.readline
reads = sys.stdin.read

def r(f=None):
    if f:
        return map(f, read().split())
    else:
        return read().split()

def rs(t,f=None):
    result = []
    result_append = result.append
    for i in xrange(t):
        if f:
            result_append(tuple(map(f, read().split())))
        else:
            result_append(list(read().split()))
    return result

####################################################
import math
sqrt = math.sqrt
from collections import deque

[x, t, a, b, da, db] = r(int)
# x = a - t1*da + b - t2*db
# a + b - x = t1*da + t2*db

if x == 0:
    w("YES")
    sys.exit()

x = a + b - x
for t1 in xrange(t+1):
    for t2 in xrange(t+1):
        if t1*da + t2*db == x:
            w("YES")
            sys.exit()
w("NO")

x, t, a, b, da, db = [int(i) for i in raw_input().split()]

pas = [a-da*i for i in range(t) if 0 <= a-da*i <= x]
pbs = [b-db*i for i in range(t) if 0 <= b-db*i <= x]
for pa in pas:
    for pb in pbs:
        if pa+pb == x:
            print 'YES'
            exit()
print 'NO'

x,t,a,b,da,db=map(int,input().split())
l1=[a]
l2=[b]
for i in range(1,t):
	l1.append(a-(i*da))
	l2.append(b-(i*db))
for t in l1:
	check=x-t
	tt=0
	if check in l2:
		tt=1
		break
if tt==0:
	print ("NO")
else:
	print ("YES")

w = input()
[x,t,a, b, da, db] = [int(i) for i in str.split(w)]
works = False

if x==0:
    print('YES')
    works = True
else:
    for i in range(t):
        for j in range(t):
            aprime = a-da*i
            bprime = b-db*j
            if x == aprime or x == bprime or x == aprime+bprime:
                print('YES')
                works = True
if not works:
    print('NO')

x, t, a, b, da, db = [int(j) for j in raw_input().split()]

if x>(a+b) or x < min(a-da*t, b-db*t):
    print 'NO'
else:
    alist = [a-da*j for j in range(t)]
    blist = [aa+b-db*j for j in range(t) for aa in alist]

    if x in blist:
        print 'YES'
    else:
        print 'NO'

w = input()
[x,t,a, b, da, db] = [int(i) for i in str.split(w)]
works = False

if x==0:
    print('YES')
else:
    for i in range(t):
        for j in range(t):
            aprime = a-da*i
            bprime = b-db*j
            if x == aprime or x == bprime or x == aprime+bprime:
                print('YES')
                works = True
if not works:
    print('NO')

x, t, a, b, da, db = map(int, input().split())
x -= a
for i in range(t):
    if (b - x) % db == 0 and (b - x) // db in range(t):
        print('YES')
        exit()
    x += da
print('NO')

def main():
    x, t, a, b, da, db = map(int, input().split())
    if x == 0:
        print("YES")
        return
    possible_a = []
    for i in range(t):
        p = x - a - (da * i)
        if p == 0:
            print("YES")
            return

        possible_a.append(p)
    for i in range(t):
        target = b - (db * i)
        for j in range(t):
            if possible_a[j] == target:
                print("YES")
                return
            elif possible_a[j] < target:
                break
    print("NO")

main()

x,t,a,b,da,db=map(int,raw_input().split())
y=(a+b)-x
f=0
for i in range(t+1):
	for j in range(t+1):
		if i*da+j*db==y:
			print "YES"
			f=1
			break
if x==0:
	print "YES"
else:
	if f==0:
		print "NO"

x,t,a,b,da,db=[int(w) for w in raw_input().split()]
aa=[]
bb=[]
for i in xrange(t):
    aa.append(a-i*da)
    bb.append(b-i*db)
cc=[]
for i in aa:
    for j in bb:
        cc.append(i+j)
print cc
if x in cc:
    print "YES"
else:
    print "NO"

x, t, a, b, la, lb = map(int, raw_input().split())
ans = False
for f in range(t):
      for s in range(t):
            if a - la * f + b - lb * s == x or a - la * f == x or b - lb * s == x:
                  ans = True
print 'YES' if ans else 'NO'

x , t , a , b , da , db = list(map(int , raw_input().split()))
ok = False
for i in range(t):
    for j in range(t):
        if a - i * da + b - j * db == x:
            ok = True

for i in range(0 , t):
    if a - da * i == x:
        ok = True
        break

for i in range(0 , t):
    if b - db * i == x:
        ok = True
        break

if ok == True:
    print "YES"
else:
    print "NO"

if __name__ == "__main__":
    x, t, a, b, da, db = map(int, input().split())
    found = False
    for i in range(t):
        for j in range(t):
            if a - i * da + b - j * db == x:
                found = True

    if found:
        print("YES")
    else:
        print("NO")

x,t,a,b,da,db = map(int,raw_input().split())

check = False

for i in range(t):
    if a==x or b==x or a+b==x:
        check = True
        break
    temp = b
    for j in range(t):
        if a==x or temp==x or a+temp==x:
            check = True
            break
        temp -= db
    a -= da
    if check:
        break

if check:
    print('YES')
else:
    print('NO')

x, t, a, b, la, lb = map(int, raw_input().split())
ans = False
for f in range(t):
      for s in range(t):
            if a - la * f + b - lb * s == x:
                  ans = True
print 'YES' if ans else 'NO'

import sys
import math

x, t, a, b, da, db = [int(x) for x in (sys.stdin.readline()).split()]
d = [0] * 300

if(x == 0):
    print("YES")
    exit()

for i in range(t):
    d[b] = 1
    b -= db

for i in range(t):
    if(d[x - a] == 1):
        print("YES")
        exit()
    else:
        a -= da

print("NO")

def main():
    x, t, a, b, da, db = map(int, input().split())
    possible_a = []
    for i in range(t):
        p = x - a - (da * i)
        if p == 0:
            print("YES")
            return

        possible_a.append(p)
    for i in range(t):
        target = b - (db * i)
        for j in range(t):
            if possible_a[j] == target:
                print("YES")
                return
            elif possible_a[j] < target:
                break
    print("NO")

main()

x,t,a,b,da,db = map(int,raw_input().split())
p1 = [-da*i + a for i in xrange(t)]
p2 = [-db*i + b for i in xrange(t)]
for i in p1:
    for j in p2:
        if i + j == x:
            print "YES"
            exit(0)
print "NO"

import collections
import functools
import itertools
import math
import operator
import re
import sys

def main():
    x, t, a, b, da, db = map(int, raw_input().split())
    for t1 in xrange(t):
        for t2 in xrange(t):
            if x == a - da * t1 + b - db * t2 or x == 0:
                print 'YES'
                return
    print 'NO'

if __name__ == '__main__':
    main()

x, t, a, b, da, db = eval("[" + raw_input().replace(' ', ',') + "]")
valid = False
for timeSolvingProblemA in range(t):
	for timeSolvingProblemB in range(t):
		totalScore = a - da * timeSolvingProblemA + b - db * timeSolvingProblemB
		if totalScore == x:
			valid = True
if valid:
	print "YES"
else:
	print "NO"

import sys
input=sys.stdin.buffer.readline

x,t,a,b,da,db=map(int,input().split())
isprinted=False
for i in range(t):
	for j in range(t):
		val=(a-i*da)+(b-j*db)
		if val==x:
			print("YES")
			isprinted=True
if isprinted==False:
	print("NO")

def gcd(a, b):
    c = a % b
    return gcd(b, c) if c else b

x, t, a, b, da, db = map(int, input().split())
if x == 0: print('YES')
else:
    if (a - x) % da == 0: print('YES')
    elif (b - x) % db == 0: print('YES')
    elif a + b - t * (da + db) > x: print('NO')
    else:
        n = a + b - x
        if n % gcd(a, b): print('NO')
        else:
            for i in range(1, t + 1):
                if (n - i * da) % db == 0:
                    n = -1
                    break
            print('YES' if n < 0 else 'NO')

def main ():
    x,t,a,b,da,db = map(int,raw_input().split())

    for i in range(0,t):
        p = a-da*i
        q = x - p

        for j in range(0,t):
            r = b - db*j

            if (r == q):
                print "YES"
                return None

    print "NO"

while (True):
    try:
        main ()

    except EOFError:
        break

import itertools as it
x, t, a, b, da, db = (int(x) for x in input().split())
if (x in (a - da * i + b - db * j for i in range(t) for j in range(t)) or
    (a > x and (a - x) % da == 0 and (a - x) // da < t) or
    (b > x and (b - x) % db == 0 and (b - x) // db < t)):
	print('YES')
else:
	print('NO')

x,t,a,b,da,db=map(int,input().split())
l1=[a]
l2=[b]
for i in range(1,t):
	l1.append(a-(i*da))
	l2.append(b-(i*db))
for t in l1:
	check=x-t
	tt=0
	if check in l2:
		tt=1
		break
if tt==0:
	print ("NO")
else:
	print ("YES")

x, t, a, b, da, db = map(int, raw_input().split())

for p in xrange(t):
    for q in xrange(t):
        if x == a + b - da * p - db * q:
            print "YES"
            exit()
print "NO"

x, t, a, b, da, db = map(int, raw_input().split())

if x == 0:
    print "YES"
    exit()

for p in xrange(t):
    for q in xrange(t):
        if x == a + b - da * p - db * q:
            print "YES"
            exit()
print "NO"

x,t,a,b,da,db=map(int,raw_input().split())
x=(a+b)-x
f=0
for i in range(t):
	for j in range(t):
		if i*da+j*db==x:
			print "YES"
			f=1
			break
if f==0:
	print "NO"

x, t, a, b, da, db = map(int, raw_input().split())
print ['NO', 'YES'][x in set([a - i * da for i in range(t)] + [b - i * db for i in range(t)] + [a + b - i * da - j * db for i in range(t) for j in range(t)])]

x,t,a,b,da,db=[int(w) for w in raw_input().split()]
aa=[]
bb=[]
for i in xrange(t):
    aa.append(a-i*da)
    bb.append(b-i*db)
cc=[0]+aa+bb
for i in aa:
    for j in bb:
        cc.append(i+j)
print cc
if x in cc:
    print "YES"
else:
    print "NO"

import itertools as it
x, t, a, b, da, db = (int(x) for x in input().split())
if x in (a - da * i + b - db * j for i in range(t) for j in range(t)):
	print('YES')
else:
	print('NO')

'''
Created on Jul 4, 2012

@author: iain
'''

import sys
if __name__ == "__main__":
    i = map(int,raw_input().split(" "))
    x,t,a,b,da,db = i[0],i[1],i[2],i[3],i[4],i[5]
    for i in range(0, t):
        temp = b
        for j in range(0, t):
            if temp + a == x:
                print "YES"
                sys.exit()
            temp = temp - db
        a = a - da
    print "NO"

x,t,a,b,da,db=map(int,raw_input().split())
if x==0:
    print "YES"
    exit(0)
for i in range(t):
    for j in range(t):
        if a+b-i*da-j*db==x:
            print "YES"
            exit(0)
print "NO"

#!/usr/bin/env python
# -*- coding: UTF-8 -*-
__author__ = 'firago'
from sys import stdin, stdout
x, t, a, b, da, db = map(int, stdin.read().split())

mina = a - da * t
minb = b - db * t
maxa = a
maxb = b
for xa in xrange(mina, maxa+1, da):
    for xb in xrange(minb, maxb + 1, db):
        if xa + xb == x:
            print "YES"
            exit()
print "NO"

x,t,a,b,da,db = map(int,raw_input().split())
ans = "NO"
for exa in xrange(2):
	for exb in xrange(2):
		for i in xrange(t):
			for j in xrange(t):
				if x==a*exa+b*exb-i*da - j*db:
					ans = "YES"
print ans

x,t,a,b,da,db = map(int, raw_input().split())

pos = list()
for i in xrange(0,t):
    for j in xrange(0,t):
        pos.append((a-i*da)+(b-j*db))
        pos.append(a-i*da)
        pos.append(b-j*db)

print pos

if x in pos or x == 0:
    print "YES"
else:
    print "NO"

#https://codeforces.com/contest/203/problem/A
l=list(map(int,input().split(' ')))
x=l[0]
t=l[1]
a=l[2]
b=l[3]
da=l[4]
db=l[5]

p=(a+b)-(x)
bhul=True

for i in range(t):
	for j in range(t):
		if(  (da*i)+(db*j)==p    ):
			print('YES')
			bhul=False
			break;

if bhul:
	print('NO')

n=input().split()
x=int(n[0])
t=int(n[1])
a=int(n[2])
b=int(n[3])
da=int(n[4])
db=int(n[5])
for i in range(t):
    for j in range(t):
        if x==a-(da*i)+b-(db*j):
            print('YES')
            exit()
        elif x==a-(da*i):
            print('YES')
            exit()
        elif x==b-(db*j):
            print('YES')
            exit()
print('NO')

x,t,a,b,da,db = map(int,raw_input().split())
p1 = [-da*i + a for i in xrange(t)]
p2 = [-db*i + b for i in xrange(t)]
for i in p1:
    for j in p2:
        if i + j == x:
            print "YES"
            exit(0)
print "NO"

x,t,a,b,da,db=map(int,input().split())
l1=[a]
l2=[b]
for i in range(1,t):
	l1.append(a-(i*da))
	l2.append(b-(i*db))
for t in l1:
	check=x-t
	tt=0
	if check in l2:
		tt=1
		break
if tt==0:
	print ("NO")
else:
	print ("YES")