AtCoder Beginner Contest 188
B
Orthogonality
AtCoder
⌀ 0
原题
← AC →
翻译中…

Problem Statement

翻译中…

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$.

翻译中…

Constraints

翻译中…
  • $1 \le N \le 100000$
  • $-100 \le A_i \le 100$
  • $-100 \le B_i \le 100$
  • All values in input are integers.
翻译中…

Input

翻译中…

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

翻译中…

Output

翻译中…

If the inner product of $A$ and $B$ is $0$, print Yes; otherwise, print No.

翻译中…

样例

Input #1
2
-3 6
4 2
Output #1
Yes
The inner product of $A$ and $B$ is $(-3) \times 4 + 6 \times 2 = 0$.
Input #2
2
4 5
-1 -3
Output #2
No
The inner product of $A$ and $B$ is $4 \times (-1) + 5 \times (-3) = -19$.
Input #3
3
1 3 5
3 -6 3
Output #3
Yes
The inner product of $A$ and $B$ is $1 \times 3 + 3 \times (-6) + 5 \times 3 = 0$.
题目信息
题号
abc188_b
时间限制
2 s
内存限制
1024 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。