n=int(input()) d=map(int,input().split()) w=map(int,input().split()) uf=list(range(n)) rv=[False]*n def f(n): if n==uf[n]: return n else: uf[n]=f(uf[n]) return uf[n] def u(a,b): uf[f(a)]=f(b) for i,di in enumerate(d): a,b=(i+di)%n,(i-di)%n u(a,b) if a==b: rv[a]=True for i,b in enumerate(rv): j=f(i) if b: rv[j]=True print("Yes" if all([rv[i] or uf.count(i)%2==0 for i in range(n)]) else "No")