Advertising on the Fence
Ivan lives in a quaint little house in the village. Recently, the fence surrounding his property was painted red. However, an advertising agent arrived in the village and began plastering ads everywhere, including on Ivan's fence.
Each day, a new advertisement is added to the fence. Over the past n days, n advertisements have been posted, and Ivan suspects that his entire fence, which consists of m boards, is now completely covered with ads. The boards are sequentially numbered from 1 to m.
Fortunately, Ivan's neighbor Petro has been keeping track of which boards were covered by ads each day. On the i-th day, Petro noted that the advertisement covered boards from l_i to r_i, inclusive. It's possible for a new ad to fully or partially cover an existing one.
To lodge a complaint with the village administration, Ivan needs to confirm that every board on the fence is indeed covered by advertisements. Your task is to help him determine if this is true.
Input
The first line of the input contains two integers m and n — the number of boards on the fence and the number of days Petro recorded his observations (1 ≤ m ≤ 10000, 1 ≤ n ≤ 1000). The following n lines each contain two integers l_i and r_i (1 ≤ l_i ≤ r_i ≤ m), indicating the range of boards covered by an advertisement on the i-th day.
Output
Print "YES" if the entire fence is covered with advertisements, otherwise print "NO".