题目描述
Problem Description
Teamwork is essential in a team competition. You are currently participating in a team-based fast-solving relay. The goal is, of course, to solve all problems (all solve).
The relay is conducted by a team of 10 people, and there are 10 problems given, from Problem 1 to Problem 10. Each team member must be responsible for exactly one problem, and no single person can solve multiple problems. A list of problems that each team member can solve is provided. Determine if the team can solve all problems collectively. Note that each team member can always solve a problem by learning the solution from another member who can solve that problem. There is a time limit in the actual relay, but it is ignored in this problem.
Input Format
The list of problems that each team member can solve is given in the following format from standard input:
$ p1,1p1,2...p1,10 $ $ p2,1p2,2...p2,10 $ : $ p10,1p10,2...p10,10 $
$ pi,j $ is either o or x. o indicates that the $ i $th member can solve Problem $ j $, and x indicates that they cannot solve it.
Output Format
If the team can solve all 10 problems, output Yes; otherwise, output No. Ensure a newline at the end of the output.
Sample Input and Output
Sample Input #1
oxxxxxxxxx
xoxxxxxxxx
xxoxxxxxxx
xxxoxxxxxx
xxxxoxxxxx
xxxxxoxxxx
xxxxxxoxxx
xxxxxxxoxx
xxxxxxxxox
xxxxxxxxxo
Sample Output #1
Yes
Sample Input #2
xxxxxxxxxx
xxxxxxxxxx
xxxxxxxxxx
xxxxxxxxxx
xxxxxxxxxx
xxxxxxxxxx
xxxxxxxxxx
xxxxxxxxxx
xxxxxxxxxx
oooooooooo
Sample Output #2
Yes
Sample Input #3
oxxxxxxxxx
ooxxxxxxxx
ooxoxxxxxx
oooxoxxxxx
oxxxxooxxx
ooxoxxoxxx
oooooxxxxx
ooooxxoxxx
ooooxoxxox
oooooooxxo
Sample Output #3
No
Notes/Hints
Sample Explanation 1
Each member can solve their own problem, allowing the team to solve all problems.
Sample Explanation 2
The 10th member can teach the solution to other members, enabling the team to solve all problems.
Sample Explanation 3
No one can solve Problem 8, so the team cannot solve all problems.
输入格式
见题面 Input 部分
输出格式
见题面 Output 部分