Check if removal of a subsequence of non-adjacent elements makes the array sorted
Given a binary array arr[] of size N, the task is to check if the array arr[] can be made sorted by removing any subsequence of non-adjacent array elements. If the array can be made sorted, then print "Yes". Otherwise, print "No". Examples: Input: arr[] = {1, 0, 1, 0, 1, 1, 0}Output: YesExplanation: