You are given an array of length . You need to find a sub-sequence of the array such that In other words, the gcd of sum of elements in and sum of elements not in is greater than 1. It is also required that both and are non-empty.
The first line contains an integer, .
The second line contains space-separated integers .
If there is no sub-sequence of the array such that print a single word “No” .
Otherwise, on the first line print a single word “Yes” . On the second the line print a single integer , the length of the chosen subsequence. On the third line print space seperated distinct integers , the indices of the elements of the chosen subsequence.
If there are multiple solutions, print any of them. You can print the indices of the chosen subsequence in any order.
Input | Output |
---|---|
5 6 2 3 5 8 | Yes 3 4 2 3 |
Here are the chosen elements. Their sum is . The other elements sum to . Since, , this is a valid answer. , , are also valid subsequences. |
Input | Output |
---|---|
2 1 3 | No |
Given a sub-sequence of an array , is the sub-sequence formed by taking all elements in and not in . For example, given an array and the subsequence , then .