/
実行時間制限: 2 sec / メモリ制限: 1024 MiB
配点 : 200 点
問題文
1 から N の番号が付いた N 人の人がいます。
また、1 から M の番号が付いた M 種類の服があります。人 i は服 F_i を着ています。
次の 2 個の質問に Yes か No で答えてください。
- 質問 1: N 人全員が異なる種類の服を着ていますか?
- 質問 2: M 種類の服全てについて、その服を着ている人が少なくとも 1 人ずついますか?
制約
- 1 \leq N \leq 100
- 1 \leq M \leq 100
- 1 \leq F_i \leq M
- 入力される値は全て整数
入力
入力は以下の形式で標準入力から与えられる。
N M F_1 F_2 \dots F_N
出力
2 行出力せよ。i 行目には質問 i の答えが Yes であれば Yes を、No であれば No を出力せよ。
入力例 1
3 4 1 2 4
出力例 1
Yes No
全員が異なる種類の服を着ているので、1 番目の質問の答えは Yes です。
また、服 3 を着ている人は存在しないので、2 番目の質問の答えは No です。
入力例 2
4 2 1 2 1 2
出力例 2
No Yes
入力例 3
4 4 1 3 2 1
出力例 3
No No
入力例 4
5 5 1 3 4 2 5
出力例 4
Yes Yes
Score : 200 points
Problem Statement
There are N people numbered 1 through N.
There are M types of clothes numbered 1 through M. Person i is wearing clothes F_i.
Answer the following two questions with Yes or No.
- Question 1: Are all N people wearing different types of clothes?
- Question 2: For every one of the M types of clothes, is there at least one person wearing that type?
Constraints
- 1 \leq N \leq 100
- 1 \leq M \leq 100
- 1 \leq F_i \leq M
- All input values are integers.
Input
The input is given from Standard Input in the following format:
N M F_1 F_2 \dots F_N
Output
Output two lines. The i-th line should contain Yes if the answer to question i is Yes, and No if it is No.
Sample Input 1
3 4 1 2 4
Sample Output 1
Yes No
Everyone is wearing a different type of clothes, so the answer to question 1 is Yes.
There is no person wearing clothes 3, so the answer to question 2 is No.
Sample Input 2
4 2 1 2 1 2
Sample Output 2
No Yes
Sample Input 3
4 4 1 3 2 1
Sample Output 3
No No
Sample Input 4
5 5 1 3 4 2 5
Sample Output 4
Yes Yes