#K81992. Stock Profit Possibility
Stock Profit Possibility
Stock Profit Possibility
You are given the number of days N and a list of stock prices P over these days. For each day i (from day 1 to day N-1), determine whether it is possible to sell the stock at a later day j (j > i) for a profit. In other words, for each i you should check if there exists any j > i such that:
$P_i < P_j$
If such a day exists, output Yes for that day; otherwise, output No. The result should be a list of exactly N-1 answers. All input and output operations are performed through stdin and stdout, respectively.
inputFormat
The first line contains an integer N (the number of days). The second line contains N space-separated integers representing the stock prices on each day.
outputFormat
Output a single line containing N-1 space-separated strings, each being either Yes or No. The i-th string indicates whether on day i it is possible to get a profit by selling the stock at some later day.
## sample5
3 1 4 1 5
Yes Yes Yes Yes