#include using namespace std; const long long MOD = 1000000007; long long modpow(long long a, long long b){ long long ans = 1; while (b > 0){ if (b % 2 == 1){ ans *= a; ans %= MOD; } a *= a; a %= MOD; b /= 2; } return ans; } long long modinv(long long a){ return modpow(a, MOD - 2); } int main(){ int N, L; cin >> N >> L; vector d(N); for (int i = 0; i < N; i++){ cin >> d[i]; } vector B(N * 2); for (int i = 0; i < N * 2; i++){ cin >> B[i]; } vector p(N * 2); for (int i = 0; i < N; i++){ p[i] = d[i]; p[N + i] = L + d[i]; } vector> s(N * 2, vector(N * 2, 0)); for (int i = 0; i < N * 2; i++){ for (int j = 0; j < N * 2; j++){ s[i][j] = min(abs(p[j] - p[i]), L * 2 - abs(p[j] - p[i])); } } vector> A(N * 2, vector(N * 2 + 1, 0)); for (int i = 0; i < N * 2; i++){ for (int j = 0; j < N * 2; j++){ A[i][j] = s[i][j]; } A[i][N * 2] = B[i]; } for (int i = 0; i < N * 2; i++){ int pv = i; for (int j = i; j < N * 2; j++){ if (A[j][i] > 0){ pv = j; } } swap(A[i], A[pv]); long long b = modinv(A[i][i]); for (int j = N * 2; j >= i; j--){ A[i][j] *= b; A[i][j] %= MOD; } for (int j = 0; j < N * 2; j++){ if (i != j){ for (int k = 0; k <= N * 2; k++){ if (k != i){ A[j][k] += MOD - A[j][i] * A[i][k] % MOD; A[j][k] %= MOD; } } A[j][i] = 0; } } } vector C(N * 2, 0); for (int i = 0; i < N * 2; i++){ if (A[i][i] > 0){ for (int j = 0; j < N * 2; j++){ C[j] += A[i][N * 2] * s[i][j]; } } } bool ok = true; for (int i = 0; i < N * 2; i++){ if (B[i] != C[i]){ ok = false; } } if (ok){ cout << "Yes" << endl; } else { cout << "No" << endl; } }