N,L=map(int,input().split()) D=list(map(int,input().split())) B=list(map(int,input().split())) for i in range(N): D.append(D[i]+L) X=[[0]*(N*2) for i in range(N*2)] for i in range(N*2): for j in range(N*2): X[i][j]=min((D[i]-D[j])%(2*L),(D[j]-D[i])%(2*L)) U=sum(B) V=sum(X[0]) if U%V: print('No') exit() Z=U//V for i in range(N*2): B[i]-=X[0][i]*Z if max([B[i]+B[i+N] for i in range(N)])==0: print('Yes') else: print('No')