Score : $200$ points
Given are two $N$-dimensional vectors $A = (A_1, A_2, A_3, \dots, A_N)$ and $B = (B_1, B_2, B_3, \dots, B_N)$.
Determine whether the inner product of $A$ and $B$ is $0$.
In other words, determine whether $A_1B_1 + A_2B_2 + A_3B_3 + \dots + A_NB_N = 0$.
Input is given from Standard Input in the following format:
$N$ $A_1$ $A_2$ $A_3$ $\dots$ $A_N$ $B_1$ $B_2$ $B_3$ $\dots$ $B_N$
If the inner product of $A$ and $B$ is $0$, print Yes
; otherwise, print No
.
2 -3 6 4 2
Yes
The inner product of $A$ and $B$ is $(-3) \times 4 + 6 \times 2 = 0$.
2 4 5 -1 -3
No
The inner product of $A$ and $B$ is $4 \times (-1) + 5 \times (-3) = -19$.
3 1 3 5 3 -6 3
Yes
The inner product of $A$ and $B$ is $1 \times 3 + 3 \times (-6) + 5 \times 3 = 0$.