#K52387. Three Consecutive Increasing Temperatures

    ID: 29298 Type: Default 1000ms 256MiB

Three Consecutive Increasing Temperatures

Three Consecutive Increasing Temperatures

You are given an integer (n) and an array of (n) integers representing daily temperatures. Your task is to determine if there exists any subsequence of three consecutive days where the temperature increases strictly, i.e., (T_i < T_{i+1} < T_{i+2}) for some (i). This problem tests your ability to analyze sequences and implement simple conditional logic.

Note: The sequence must consist of three consecutive days.

inputFormat

The first line contains a single integer (n) representing the number of days. The second line contains (n) space-separated integers, where each integer represents the temperature recorded on that day.

outputFormat

Output a single line containing either "YES" if there exists any three consecutive days with strictly increasing temperatures, or "NO" otherwise.## sample

5
22 23 25 24 26
YES

</p>