SP28466 TAP2016L - Leonardo de Pisa

Description

**Due to SPOJ restrictions, this problem has been modified with respect to the original version used in the Argentinian Programming Tournament of 2016 in order to have multiple test cases per input file. The original version of this problem (in Spanish) can be found at \]** **Leonardo de Pisa is a very cautious man, and even though Christmas is still many months away, he has already bought his Christmas tree. It is a very, very high tree, even higher than the Tower of Pisa. Leonardo wishes to decorate his tree by using colored balls and lights. To that end, he has bought many balls of each possible integer diameter between 1 and N. In fact, he has bought so many balls that he has no idea of what to do with all of them.**

Input Format

There are multiple test cases in the input file. For each test case, the first line contains two integers **N** and **K**, with **N** representing the maximum diameter of the balls, and **K** representing the number of lights in the string (**2 ****10 $ ^{5} $** ). The second line contains **K** integers **L $ _{1} $ , L $ _{2} $ , ..., L $ _{k} $** describing the string of lights. The ith integer **L $ _{i} $** represents the type of the **i-**th light in the string (**1** ****L $ _{i} $** ****N** for **i** between **1** and **K**).********

Output Format

For each test case, write a single line containing a single character, indicating whether Leonardo can place the string of lights or not. The character must be an '**S**' if Leonardo can place the string of lights, and an '**N**' otherwise.