#if 1
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <stack>
#include <array>
#include <deque>
#include <algorithm>
#include <utility>
#include <cstdint>
#include <functional>
#include <iomanip>
#include <numeric>
#include <assert.h>
#include <bitset>
#include <list>

auto& in = std::cin;
auto& out = std::cout;
#define all(C) std::begin(C), std::end(C)

int32_t N;
int32_t A;

int main()
{
	using std::endl;
	in.sync_with_stdio(false);
	out.sync_with_stdio(false);
	in.tie(nullptr);
	out.tie(nullptr);

	in >> N >> A; N %= 500;
	if (A >= N) {
		out << "Yes" << endl;
	}
	else {
		out << "No" << endl;
	}

	return 0;
}
#endif


#if 0
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <stack>
#include <array>
#include <deque>
#include <algorithm>
#include <utility>
#include <cstdint>
#include <functional>
#include <iomanip>
#include <numeric>
#include <assert.h>
#include <bitset>
#include <list>

auto& in = std::cin;
auto& out = std::cout;
#define all(C) std::begin(C), std::end(C)

int32_t N;
int32_t a[10000];
int main()
{
	using std::endl;
	in.sync_with_stdio(false);
	out.sync_with_stdio(false);
	in.tie(nullptr);
	out.tie(nullptr);

	in >> N;
	for (size_t i = 0; i < N; i++)
	{
		in >> a[i];
	}

	std::sort(a, a + N, std::greater<>{});

	int32_t sum = 0;
	for (size_t i = 0; i < N; i++)
	{
		if (i & 1) {
			sum -= a[i];
		}
		else {
			sum += a[i];
		}
	}

	out << sum << endl;

	return 0;
}
#endif

#if 0
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <stack>
#include <array>
#include <deque>
#include <algorithm>
#include <utility>
#include <cstdint>
#include <functional>
#include <iomanip>
#include <numeric>
#include <assert.h>
#include <bitset>
#include <list>

auto& in = std::cin;
auto& out = std::cout;
#define all(C) std::begin(C), std::end(C)

int32_t H,W;


template<typename T, typename U>
std::enable_if_t<std::rank<T>::value == 0> fill_all(T& arr, const U& v) {
	arr = v;
}
template<typename ARR, typename U>
std::enable_if_t<std::rank<ARR>::value != 0> fill_all(ARR& arr, const U& v) {
	for (auto& i : arr) {
		fill_all(i, v);
	}
}

char map[60][60];
int32_t D[55][55];

int main()
{
	using std::endl;
	in.sync_with_stdio(false);
	out.sync_with_stdio(false);
	in.tie(nullptr);
	out.tie(nullptr);

	in >> H>>W;
	for (size_t i = 0; i <= W+1; i++) {
		map[0][i] = '#';
		map[H+1][i] = '#';
	}
	int W_COUNT = 0;
	for (size_t i = 1; i <= H; i++)
	{
		map[i][0] = '#';
		in >> (map[i] + 1);
		W_COUNT += std::count_if(map[i] + 1, map[i] + 1 + W, [](char c) {return c == '.'; });
		map[i][W+1] = '#';
	}

	fill_all(D, 505050);
	std::queue<std::pair<int, int>> queue;
	queue.emplace(1, 1);
	D[1][1] = 1;
	while (!queue.empty())
	{
		auto top = queue.front(); queue.pop();

		int cost = D[top.first][top.second] + 1;
		const int diff[] = { 0,1,0,-1,0 };
		for (size_t i = 0; i < 4; i++)
		{
			std::pair<int, int> next = top;
			next.first += diff[i];
			next.second += diff[i+1];
			if (cost < D[next.first][next.second] && map[next.first][next.second]=='.') {

				queue.emplace(next);
				D[next.first][next.second] = cost;
			}
		}

	}

	if (D[H][W]== 505050) {
		out << -1 << endl;
	}
	else {
		out << W_COUNT- D[H][W] << endl;
	}

	return 0;
}
#endif


Measured memory_bytes: 888