AtCoder Beginner Contest 205
B
Permutation Check
AtCoder
⌀ 0
原题
← AC →
翻译中…

Problem Statement

翻译中…

You are given a sequence of $N$ integers between $1$ and $N$ (inclusive): $A = (A_1, A_2, \dots, A_N)$.

翻译中…

Determine whether $A$ is a permutation of $(1, 2, \dots, N)$.

翻译中…

Constraints

翻译中…
  • $1 \leq N \leq 10^3$
  • $1 \leq A_i \leq N$
  • All values in input are integers.
翻译中…

Input

翻译中…

Input is given from Standard Input in the following format:

翻译中…

N
A_1 A_2 \ldots A_N

翻译中…

Output

翻译中…

If $A$ is a permutation of $(1, 2, \dots, N)$, print Yes; otherwise, print No.

翻译中…

样例

Input #1
5
3 1 2 4 5
Output #1
Yes
$(3, 1, 2, 4, 5)$ is a permutation of $(1, 2, 3, 4, 5)$, so we should print `Yes`.
Input #2
6
3 1 4 1 5 2
Output #2
No
$(3, 1, 4, 1, 5, 2)$ is not a permutation of $(1, 2, 3, 4, 5, 6)$, so we should print `No`.
Input #3
3
1 2 3
Output #3
Yes
Input #4
1
1
Output #4
Yes
题目信息
题号
abc205_b
时间限制
2 s
内存限制
1024 MB

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