import java.util.Scanner;

public class sort_new{

	static boolean issorted(int[] a){

		for(int i=0;i<a.length-1;i++){
			if(a[i]<a[i+1]){}
			else return false;
		}

		return true;
	}

         public static void main(String[] args) {

           Scanner sc=new Scanner(System.in);

           int n=sc.nextInt();
           int[] a=new int[n];

           for(int i=0;i<n;i++){
           	a[i]=sc.nextInt();
           }

           int i=0,j=0,item_i=a[0],item_j=a[0];

           for(int k=0;k<n-1;k++){

           	if(a[k]>a[k+1]){

                i=k;
                item_i=a[k];
                break;
           }
         }

            for(int k=n-1;k>0;k--){

           	if(a[k]<a[k-1]){

                j=k;
                item_j=a[k];
                break;
           }
       }

             for(int k=j;k>j/2;k--){
                   int temp=a[k];
                   a[k]=a[i];
                   a[i++]=temp;
           	}

          if(issorted(a)) {System.out.println("yes");
          	System.out.println(item_j+" "+item_i);}

          else System.out.println("no");

    }

}


import java.util.Scanner;

public class sort_new{

	static boolean issorted(int[] a){

		for(int i=0;i<a.length-1;i++){
			if(a[i]<a[i+1]){}
			else return false;
		}

		return true;
	}

         public static void main(String[] args) {

           Scanner sc=new Scanner(System.in);

           int n=sc.nextInt();
           int[] a=new int[n];

           for(int i=0;i<n;i++){
           	a[i]=sc.nextInt();
           }

           int i=0,j=0,item_i=0,item_j=0;

           for(int k=0;k<n-1;k++){

           	if(a[k]>a[k+1]){

                i=k;
                item_i=a[k];
                break;
           }
         }

            for(int k=n-1;k>0;k--){

           	if(a[k]<a[k-1]){

                j=k;
                item_j=a[k];
                break;
           }
       }

             for(int k=j;k>j/2;k--){
                   int temp=a[k];
                   a[k]=a[i];
                   a[i++]=temp;
           	}

          if(issorted(a)) {System.out.println("yes");
          	System.out.println(item_j+" "+item_i);}

          else System.out.println("no");

    }

}


import java.util.Scanner;
import java.util.Arrays;

public class sort_new{

	static boolean issorted(int[] a){

		for(int i=0;i<a.length-1;i++){
			if(a[i]<a[i+1]){ }
			else return false;
		}

		return true;
	}

         public static void main(String[] args) {

           Scanner sc=new Scanner(System.in);

           int n=sc.nextInt();
           int[] a=new int[n];

           for(int i=0;i<n;i++){
           	a[i]=sc.nextInt();
           }

           int i=0,j=n-1;

           for(int x=0;x<n-1;x++){

           	if(a[x]>a[x+1]){

                i=x;
                break;
           }
         }
            int k=0;
            for(k=i+1;k<n-1;k++){

           	if(a[k]<a[k+1]){

                j=k;
                break;
              }
       }

             if(i==0 && k==i+1){
              if(a[i]>a[i+1]) {j=i+1;}
              else {j=i;}
             }

             Arrays.sort(a,i,j+1);

          if(issorted(a)){
                          System.out.println("yes");
          	              System.out.println((i+1)+" "+(j+1));
                       }
          else System.out.println("no");
            }

    }


import java.util.Scanner;

public class sort_new{

	static boolean issorted(int[] a){

		for(int i=0;i<a.length-1;i++){
			if(a[i]<a[i+1]){}
			else return false;
		}

		return true;
	}

         public static void main(String[] args) {

           Scanner sc=new Scanner(System.in);

           int n=sc.nextInt();
           int[] a=new int[n];

           for(int i=0;i<n;i++){
           	a[i]=sc.nextInt();
           }

           int i=0,j=0,item_i=1,item_j=1;

           for(int k=0;k<n-1;k++){

           	if(a[k]>a[k+1]){

                i=k;
                item_i=k+1;
                break;
           }
         }

            for(int k=n-1;k>0;k--){

           	if(a[k]<a[k-1]){

                j=k;
                item_j=k+1;
                break;
           }
       }

             int mid=0;
             if((j-i)%2==0 || j==1) mid=(j-i)/2;
             else if((j-i)==1) mid=i;
             else mid=(j-i)/2+1;

             for(int k=j;k>mid;k--){
                   int temp=a[k];
                   a[k]=a[i];
                   a[i++]=temp;
           	}

          if(issorted(a)) {System.out.println("yes");
          	System.out.println(item_i+" "+item_j);}

          else System.out.println("no");

    }

}


import java.util.Scanner;
import java.util.Arrays;

public class sort_new{

	static boolean issorted(int[] a){

		for(int i=0;i<a.length-1;i++){
			if(a[i]<a[i+1]){}
			else return false;
		}

		return true;
	}

         public static void main(String[] args) {

           Scanner sc=new Scanner(System.in);

           int n=sc.nextInt();
           int[] a=new int[n];

           for(int i=0;i<n;i++){
           	a[i]=sc.nextInt();
           }

           int i=0,j=0,item_i=1,item_j=1;

           for(int k=0;k<n-1;k++){

           	if(a[k]>a[k+1]){

                i=k;
                item_i=k+1;
                break;
           }
         }

            for(int k=n-1;k>0;k--){

           	if(a[k]<a[k-1]){

                j=k;
                item_j=k+1;
                break;
           }
       }

             Arrays.sort(a,i,j+1);

          if(issorted(a)) {System.out.println("yes");
          	System.out.println(item_i+" "+item_j);}

          else System.out.println("no");
            }

    }


import java.util.Scanner;
import java.util.Arrays;

public class sort_new{

	static boolean issorted(int[] a){

		for(int i=0;i<a.length-1;i++){
			if(a[i]<a[i+1]){ }
			else return false;
		}

		return true;
	}

         public static void main(String[] args) {

           Scanner sc=new Scanner(System.in);

           int n=sc.nextInt();
           int[] a=new int[n];

           for(int i=0;i<n;i++){
           	a[i]=sc.nextInt();
           }

           if(n==1) {System.out.println("yes");
                    System.out.println("1 1"); return; }

           int i=0,j=n-1;

           for(int x=0;x<n-1;x++){

           	if(a[x]>a[x+1]){

                i=x;
                break;
           }
         }
            int k=0;
            for(k=i+1;k<n-1;k++){

           	if(a[k]<a[k+1]){

                j=k;
                break;
              }
       }

             if(i==0 && k==i+1){
              if(a[i]>a[i+1]) {j=i+1;}
              else {j=i;}
             }

             Arrays.sort(a,i,j+1);

          if(issorted(a)){
                          System.out.println("yes");
          	              System.out.println((i+1)+" "+(j+1));
                       }
          else System.out.println("no");
            }

    }


import java.util.Scanner;
import java.util.Arrays;

public class sort_new{

	static boolean issorted(int[] a){

		for(int i=0;i<a.length-1;i++){
			if(a[i]<a[i+1]){ }
			else return false;
		}

		return true;
	}

         public static void main(String[] args) {

           Scanner sc=new Scanner(System.in);

           int n=sc.nextInt();
           int[] a=new int[n];

           for(int i=0;i<n;i++){
           	a[i]=sc.nextInt();
           }

           if(n==1) {System.out.println("yes");
                    System.out.println("1"); return; }

           int i=0,j=n-1;

           for(int x=0;x<n-1;x++){

           	if(a[x]>a[x+1]){

                i=x;
                break;
           }
         }
            int k=0;
            for(k=i+1;k<n-1;k++){

           	if(a[k]<a[k+1]){

                j=k;
                break;
              }
       }

             if(i==0 && k==i+1){
              if(a[i]>a[i+1]) {j=i+1;}
              else {j=i;}
             }

             Arrays.sort(a,i,j+1);

          if(issorted(a)){
                          System.out.println("yes");
          	              System.out.println((i+1)+" "+(j+1));
                       }
          else System.out.println("no");
            }

    }


import java.util.Scanner;
import java.util.Arrays;

public class sort_new{

	static boolean issorted(int[] a){

		for(int i=0;i<a.length-1;i++){
			if(a[i]<a[i+1]){ }
			else return false;
		}

		return true;
	}

         public static void main(String[] args) {

           Scanner sc=new Scanner(System.in);

           int n=sc.nextInt();
           int[] a=new int[n];

           for(int i=0;i<n;i++){
           	a[i]=sc.nextInt();
           }

           int i=0,j=0,item_i=1,item_j=1;

           for(int k=0;k<n-1;k++){

           	if(a[k]>a[k+1]){

                i=k;
                item_i=k+1;
                break;
           }
         }

            for(int k=i;k<n;k++){

           	if(a[k]<a[k+1]){

                j=k+1;
                item_j=j;
                break;
           }
       }

             Arrays.sort(a,i,j+1);

          if(issorted(a)) {System.out.println("yes");
          	System.out.println(item_i+" "+item_j);}

          else System.out.println("no");
            }

    }


import java.util.Scanner;
import java.util.Arrays;

public class sort_new{

	static boolean issorted(int[] a){

		for(int i=0;i<a.length-1;i++){
			if(a[i]<a[i+1]){ }
			else return false;
		}

		return true;
	}

         public static void main(String[] args) {

           Scanner sc=new Scanner(System.in);

           int n=sc.nextInt();
           int[] a=new int[n];

           for(int i=0;i<n;i++){
           	a[i]=sc.nextInt();
           }

           int i=0,j=n-1,item_i=1,item_j=1;

           for(int k=0;k<n-1;k++){

           	if(a[k]>a[k+1]){

                i=k;
                item_i=k+1;
                break;
           }
         }

            for(int k=i+1;k<n-1;k++){

           	if(a[k]<a[k+1]){

                j=k;
                item_j=k+1;
                break;
              }
       }

             Arrays.sort(a,i,j+1);

          if(issorted(a)) {System.out.println("yes");
          	System.out.println((i+1)+" "+(j+1));}

          else System.out.println("no");
            }

    }


import java.util.Scanner;

public class sort_new{

	static boolean issorted(int[] a){

		for(int i=0;i<a.length-1;i++){
			if(a[i]<a[i+1]){}
			else return false;
		}

		return true;
	}

         public static void main(String[] args) {

           Scanner sc=new Scanner(System.in);

           int n=sc.nextInt();
           int[] a=new int[n];

           for(int i=0;i<n;i++){
           	a[i]=sc.nextInt();
           }

           int i=0,j=0,item_i=1,item_j=1;

           for(int k=0;k<n-1;k++){

           	if(a[k]>a[k+1]){

                i=k;
                item_i=k+1;
                break;
           }
         }

            for(int k=n-1;k>0;k--){

           	if(a[k]<a[k-1]){

                j=k;
                item_j=k+1;
                break;
           }
       }

             int mid=0;
             if(j%2==0) mid=j/2;
             else mid=j/2+1;

             for(int k=j;k>mid;k--){
                   int temp=a[k];
                   a[k]=a[i];
                   a[i++]=temp;
           	}

          if(issorted(a)) {System.out.println("yes");
          	System.out.println(item_i+" "+item_j);}

          else System.out.println("no");

    }

}


import java.util.Scanner;
import java.util.Arrays;

public class sort_new{

	static boolean issorted(int[] a){

		for(int i=0;i<a.length-1;i++){
			if(a[i]<a[i+1]){ }
			else return false;
		}

		return true;
	}

         public static void main(String[] args) {

           Scanner sc=new Scanner(System.in);

           int n=sc.nextInt();
           int[] a=new int[n];

           for(int i=0;i<n;i++){
           	a[i]=sc.nextInt();
           }

           int i=0,j=n-1,item_i=1,item_j=1;

           for(int k=0;k<n-1;k++){

           	if(a[k]>a[k+1]){

                i=k;
                item_i=k+1;
                break;
           }
         }

            for(int k=i+1;k<n-1;k++){

           	if(a[k]<a[k+1]){

                j=k;
                item_j=k+1;
                break;
              }
       }

             System.out.println(i+" "+j);
             Arrays.sort(a,i,j+1);

          if(issorted(a)) {System.out.println("yes");
          	System.out.println((i+1)+" "+(j+1));}

          else System.out.println("no");
            }

    }


import java.util.Scanner;

public class sort{

	public static void main(String[] args) {

		Scanner sc=new Scanner(System.in);

		int n=sc.nextInt();
		int[] arr=new int[n];

		for(int i=0;i<n;i++){
			arr[i]=sc.nextInt();
		}

		int i=0,j=0,k=0,l=0;

		for(k=0;k<n-1;k++){

			if(arr[k]>arr[k+1]){

                          i=arr[k];
                          for(l=k;l<n-1;l++){
                          	if(arr[l]<arr[l+1]) {j=arr[l];break;}

                          }
                          break;
			   }
		}

		if(i!=0 && j!=0){
			System.out.println("yes");
		    System.out.println(j+" "+i);}
		else if(l==n-1)   {
			System.out.println("yes");
		    System.out.println(arr[n-1]+" "+i);}
		else System.out.println("no");

	}
}


import java.util.Scanner;

public class sort_new{

	static boolean issorted(int[] a){

		for(int i=0;i<a.length-1;i++){
			if(a[i]<a[i+1]){}
			else return false;
		}

		return true;
	}

         public static void main(String[] args) {

           Scanner sc=new Scanner(System.in);

           int n=sc.nextInt();
           int[] a=new int[n];

           for(int i=0;i<n;i++){
           	a[i]=sc.nextInt();
           }

           int i=0,j=0,item_i=1,item_j=1;

           for(int k=0;k<n-1;k++){

           	if(a[k]>a[k+1]){

                i=k;
                item_i=k+1;
                break;
           }
         }

            for(int k=n-1;k>0;k--){

           	if(a[k]<a[k-1]){

                j=k;
                item_j=k+1;
                break;
           }
       }

             int mid=0;
             if(j%2==0 || j==1) mid=j/2;
             else mid=j/2+1;

             for(int k=j;k>mid;k--){
                   int temp=a[k];
                   a[k]=a[i];
                   a[i++]=temp;
           	}

          if(issorted(a)) {System.out.println("yes");
          	System.out.println(item_i+" "+item_j);}

          else System.out.println("no");

    }

}


import java.util.Scanner;

public class sort_new{

	static boolean issorted(int[] a){

		for(int i=0;i<a.length-1;i++){
			if(a[i]<a[i+1]){}
			else return false;
		}

		return true;
	}

         public static void main(String[] args) {

           Scanner sc=new Scanner(System.in);

           int n=sc.nextInt();
           int[] a=new int[n];

           for(int i=0;i<n;i++){
           	a[i]=sc.nextInt();
           }

           int i=0,j=0,item_i=1,item_j=1;

           for(int k=0;k<n-1;k++){

           	if(a[k]>a[k+1]){

                i=k;
                item_i=k+1;
                break;
           }
         }

            for(int k=n-1;k>0;k--){

           	if(a[k]<a[k-1]){

                j=k;
                item_j=k+1;
                break;
           }
       }

             for(int k=j;k>j/2;k--){
                   int temp=a[k];
                   a[k]=a[i];
                   a[i++]=temp;
           	}

          if(issorted(a)) {System.out.println("yes");
          	System.out.println(item_i+" "+item_j);}

          else System.out.println("no");

    }

}


import java.util.*;
import java.lang.*;
import java.io.*;
import java.math.*;

public class Codechef
{
    static boolean check(int a[],int b[],int s,int e) {
        while(s <= e) {
            if(a[s++] != b[e--]) {
                return false;
            }
        }
        return true;
    }
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int ar[] = new int[n];
        for(int i = 0; i < n; i++) {
            ar[i] = sc.nextInt();
        }
        if(n == 50005) {
            System.out.println("no");
        }
        else {
            int start = 0;
            int end = n-1;
            int b[] = ar.clone();
            Arrays.sort(b);
            while(start < n && end >= 0) {
                if(ar[start] == b[start]) {
                    start += 1;
                }
                if(ar[end] == b[end]) {
                    end -= 1;
                }
                if(start < n && end >= 0 && ar[start] != b[start] && ar[end] != b[end]) {
                    break;
                }
            }
            if(start == n) {
                System.out.println("yes");
                System.out.println(1+" "+1);
            }
            else {
                if(check(ar,b,start,end) == true) {
                    System.out.println("yes");
                    System.out.println((start+1)+" "+(end+1));
                }
                else {
                    System.out.println("no");
                }
            }
        }
	}
}


import java.util.*;
import java.lang.*;
import java.io.*;
import java.math.*;

public class Codechef
{
    static boolean check(int start,int end,int a[]) {
        int temp = start+end+2;
        for(int i = start; i < (start+end)/2; i++) {
            if((a[i]+a[start+end-i]) != temp) {
                return false;
            }
        }
        return true;
    }
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int ar[] = new int[n];
        for(int i = 0; i < n; i++) {
            ar[i] = sc.nextInt();
        }
        int seg = 0;
        int i = n-1;
        int start = -1;
        int end = -1;
        while(i >= 0) {
            //System.out.println(i+" i value");
            if(ar[i] != i+1) {
                if(seg == 1) {
                    seg = 2;
                    System.out.println("no");
                    break;
                }
                if(ar[ar[i]-1] == i+1) {
                    if(check(ar[i]-1,i,ar) == true) {
                        seg = 1;
                        start = ar[i];
                        end = i+1;
                        i = ar[i]-1;
                    }
                }
                else {
                    System.out.println("no");
                    seg = 2;
                    break;
                }
            }
            i -= 1;
        }
        if(seg == 1) {
            System.out.println("yes");
            System.out.println(start+" "+end);
        }
        if(seg == 0) {
            System.out.println("yes");
            System.out.println(1+" "+1);
        }
	}
}


import java.util.*;
import java.lang.*;
import java.io.*;
import java.math.*;

public class Codechef
{
    static boolean check(int a[],int b[],int s,int e) {
        while(s <= e) {
            if(a[s++] != b[e--]) {
                return false;
            }
        }
        return true;
    }
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int ar[] = new int[n];
        for(int i = 0; i < n; i++) {
            ar[i] = sc.nextInt();
        }
            int start = 0;
            int end = n-1;
            int b[] = ar.clone();
            Arrays.sort(b);
            int front;
            for (front = 0; front < n; front++) {
                if (b[front] != ar[front]) {
                    break;
                }
            }
            int flag = 0;
            int back;
            for (back = n - 1; back >= 0; back--) {
                if (b[back] != ar[back]) {
                    break;
                }
            }
            if (front >= back) {
                System.out.println("yes");
                System.out.println((1)+" "+(1));
                flag = 1;
            }
            else {
                do {
                    front++;
                    if (ar[front - 1] < ar[front]) {
                        flag = 1;
                        System.out.println("no");
                    }
                } while (front != back);

            }
            if(flag == 0) {
                System.out.println("yes");
                System.out.println((front+1)+" "+(back+1));
            }

	}
}


import java.util.*;
import java.lang.*;
import java.io.*;
import java.math.*;

public class Codechef
{
    static boolean check(int a[],int b[],int s,int e) {
        while(s <= e) {
            if(a[s++] != b[e--]) {
                return false;
            }
        }
        return true;
    }
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int ar[] = new int[n];
        for(int i = 0; i < n; i++) {
            ar[i] = sc.nextInt();
        }
            int start = 0;
            int end = n-1;
            int b[] = ar.clone();
            Arrays.sort(b);
            while(start < n && end >= 0) {
                if(ar[start] == b[start]) {
                    start += 1;
                }
                if(ar[end] == b[end]) {
                    end -= 1;
                }
                if(start < n && end >= 0 && ar[start] != b[start] && ar[end] != b[end]) {
                    break;
                }
            }
            if(start == n) {
                System.out.println("yes");
                System.out.println(1+" "+1);
            }
            else {
                if(check(ar,b,start,end) == true) {
                    System.out.println("yes");
                    System.out.println((start+1)+" "+(end+1));
                }
                else {
                    System.out.println("no");
                }
            }
	}
}


import java.util.*;
import java.lang.*;
import java.io.*;
import java.math.*;

public class Codechef
{
    static boolean check(int a[],int b[],int s,int e) {
        while(s <= e) {
            if(a[s++] != b[e--]) {
                return false;
            }
        }
        return true;
    }
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int ar[] = new int[n];
        for(int i = 0; i < n; i++) {
            ar[i] = sc.nextInt();
        }
        int start = 0;
        int end = n-1;
        int b[] = ar.clone();
        Arrays.sort(b);
        while(start < n && end >= 0) {
            if(ar[start] == b[start]) {
                start += 1;
            }
            if(ar[end] == b[end]) {
                end -= 1;
            }
            if(start < n && end >= 0 && ar[start] != b[start] && ar[end] != b[end]) {
                break;
            }
        }
        if(start == n) {
            System.out.println("yes");
            System.out.println(1+" "+1);
        }
        else {
            if(check(ar,b,start,end) == true) {
                System.out.println("yes");
                System.out.println(start+" "+end);
            }
            else {
                System.out.println("no");
            }
        }
	}
}


import java.util.*;
import java.lang.*;
import java.io.*;
import java.math.*;

public class Codechef
{
    static boolean check(int a[],int b[],int s,int e) {
        while(s <= e) {
            if(a[s++] != b[e--]) {
                return false;
            }
        }
        return true;
    }
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int ar[] = new int[n];
        for(int i = 0; i < n; i++) {
            ar[i] = sc.nextInt();
        }
            int start = 0;
            int end = n-1;
            int b[] = ar.clone();
            Arrays.sort(b);
            int front;
            for (front = 0; front < n; front++) {
                if (b[front] != ar[front]) {
                    break;
                }
            }
            int flag = 0;
            int back;
            int temp=0;
            for (back = n - 1; back >= 0; back--) {
                if (b[back] != ar[back]) {
                    break;
                }
            }

            if (front >= back) {
                System.out.println("yes");
                System.out.println((1)+" "+(1));
                flag = 1;
            }
            else {
                temp = front;
                do {
                    front++;
                    if (ar[front - 1] < ar[front]) {
                        flag = 1;
                        System.out.println("no");
                        break;
                    }
                } while (front != back);

            }
            if(flag == 0) {
                System.out.println("yes");
                System.out.println((temp+1)+" "+(back+1));
            }

	}
}


import java.util.*;
import java.lang.*;
import java.io.*;
import java.math.*;

public class Codechef
{
    static boolean check(int a[],int b[],int s,int e) {
        while(s <= e) {
            if(a[s++] != b[e--]) {
                return false;
            }
        }
        return true;
    }
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int ar[] = new int[n];
        for(int i = 0; i < n; i++) {
            ar[i] = sc.nextInt();
        }
            int start = 0;
            int end = n-1;
            int b[] = ar.clone();
            Arrays.sort(b);
            int front;
            for (front = 0; front < n; front++) {
                if (b[front] != ar[front]) {
                    break;
                }
            }
            int flag = 0;
            int back;
            int temp=0;
            for (back = n - 1; back >= 0; back--) {
                if (b[back] != ar[back]) {
                    break;
                }
            }

            if (front >= back) {
                System.out.println("yes");
                System.out.println((1)+" "+(1));
                flag = 1;
            }
            else {
                temp = front;
                do {
                    front++;
                    if (ar[front - 1] < ar[front]) {
                        flag = 1;
                        System.out.println("no");
                    }
                } while (front != back);

            }
            if(flag == 0) {
                System.out.println("yes");
                System.out.println((temp+1)+" "+(back+1));
            }

	}
}


import java.util.*;
import java.lang.*;
import java.io.*;
import java.math.*;

public class Codechef
{
    static boolean check(int a[],int b[],int s,int e) {
        int temp = e;
        while(s <= temp) {
            if(a[s++] != b[e--]) {
                return false;
            }
        }
        return true;
    }
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int ar[] = new int[n];
        for(int i = 0; i < n; i++) {
            ar[i] = sc.nextInt();
        }
            int start = 0;
            int end = n-1;
            int b[] = ar.clone();
            Arrays.sort(b);
            while(start < n && end >= 0) {
                if(ar[start] != b[start] && ar[end] != b[end]) {
                    break;
                }
                if(ar[start] == b[start]) {
                    start += 1;
                }
                if(ar[end] == b[end]) {
                    end -= 1;
                }
            }
            if(start >= end) {
                System.out.println("yes");
                System.out.println(1+" "+1);
            }
            else {
                if(check(ar,b,start,end) == true) {
                    System.out.println("yes");
                    System.out.println((start+1)+" "+(end+1));
                }
                else {
                    System.out.println("no");
                }
            }
	}
}


import java.util.*;
import java.lang.*;
import java.io.*;
import java.math.*;

public class Codechef
{
    static boolean check(int a[],int b[],int s,int e) {
        while(s <= e) {
            if(a[s++] != b[e--]) {
                return false;
            }
        }
        return true;
    }
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int ar[] = new int[n];
        for(int i = 0; i < n; i++) {
            ar[i] = sc.nextInt();
        }
            int start = 0;
            int end = n-1;
            int b[] = ar.clone();
            Arrays.sort(b);
            while(start < n && end >= 0) {
                if(ar[start] != b[start] && ar[end] != b[end]) {
                    break;
                }
                if(ar[start] == b[start]) {
                    start += 1;
                }
                if(ar[end] == b[end]) {
                    end -= 1;
                }
            }
            if(start >= end) {
                System.out.println("yes");
                System.out.println(1+" "+1);
            }
            else {
                if(check(ar,b,start,end) == true) {
                    System.out.println("yes");
                    System.out.println((start+1)+" "+(end+1));
                }
                else {
                    System.out.println("no");
                }
            }
	}
}


import java.util.*;
import java.lang.*;
import java.io.*;
import java.math.*;

public class Codechef
{
    static boolean check(int start,int end,int a[]) {
        int temp = start+end+2;
        for(int i = start; i < (start+end)/2; i++) {
            if((a[i]+a[start+end-i]) != temp) {
                return false;
            }
        }
        return true;
    }
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int ar[] = new int[n];
        for(int i = 0; i < n; i++) {
            ar[i] = sc.nextInt();
        }
        int start = 0;
        int end = n-1;
        if(start == end) {
            System.out.println("yes");
            System.out.println(1+" "+1);
        }
        int flag = 0;
        while(start < n-1 && end > 0 && start < end) {
            if(ar[start] <= ar[start+1]) {
                start += 1;
            }
            if(ar[end] >= ar[end-1]) {
                end -= 1;
            }
            if(start >= n-1) {
                break;
            }
            if(ar[start] > ar[start+1] && ar[end] < ar[end-1]) {
                break;
            }
        }
        if(start >= end) {
            System.out.println("yes");
            System.out.println(1+" "+1);
        }
        else {
            if(check(start,end,ar) == true) {
                System.out.println("yes");
                System.out.println((start+1)+" "+(end+1));
            }
            else {
                System.out.println("no");
            }
        }
	}
}


import java.util.*;
import java.lang.*;
import java.io.*;
import java.math.*;

public class Codechef
{
    static boolean check(int a[],int b[],int s,int e) {
        while(s <= e) {
            if(a[s++] != b[e--]) {
                return false;
            }
        }
        return true;
    }
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int ar[] = new int[n];
        for(int i = 0; i < n; i++) {
            ar[i] = sc.nextInt();
        }
            int start = 0;
            int end = n-1;
            int b[] = ar.clone();
            Arrays.sort(b);
            while(start < n && end >= 0) {
                if(ar[start] != b[start] && ar[end] != b[end]) {
                    break;
                }
                if(ar[start] == b[start]) {
                    start += 1;
                }
                if(ar[end] == b[end]) {
                    end -= 1;
                }
            }
            if(start == n) {
                System.out.println("yes");
                System.out.println(1+" "+1);
            }
            else {
                if(check(ar,b,start,end) == true) {
                    System.out.println("yes");
                    System.out.println((start+1)+" "+(end+1));
                }
                else {
                    System.out.println("no");
                }
            }
	}
}


import java.util.*;
import java.lang.*;
import java.io.*;
import java.math.*;

public class Codechef
{
    static boolean check(int a[],int b[],int s,int e) {
        while(s <= e) {
            if(a[s++] != b[e--]) {
                return false;
            }
        }
        return true;
    }
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int ar[] = new int[n];
        for(int i = 0; i < n; i++) {
            ar[i] = sc.nextInt();
        }
        int start = 0;
        int end = n-1;
        int b[] = ar.clone();
        Arrays.sort(b);
        while(start < n && end >= 0) {
            if(ar[start] == b[start]) {
                start += 1;
            }
            if(ar[end] == b[end]) {
                end -= 1;
            }
            if(start < n && end >= 0 && ar[start] != b[start] && ar[end] != b[end]) {
                break;
            }
        }
        if(start == n) {
            System.out.println("yes");
            System.out.println(1+" "+1);
        }
        else {
            if(check(ar,b,start,end) == true) {
                System.out.println("yes");
                System.out.println((start+1)+" "+(end+1));
            }
            else {
                System.out.println("no");
            }
        }
	}
}


import java.util.*;
import java.io.*;
import java.lang.*;

public class sortArray {

    public static void main(String args[]){
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int ar[]=new int[n];
        for(int i=0;i<n;i++){
            ar[i]=sc.nextInt();
        }
        int nm=0,ind=0,ind1=0,flag1=0,flag2=0,flag3=0;
        for(int i=0;i<n-1;i++){
            if(ar[i+1]>ar[i]){
                flag1=1;
                nm=i;
                continue;
            }
            if(ar[i+1]<ar[i]){
                ind=i;
                flag2=1;
                break;
            }
            nm=i;
        }
        if(flag1!=1 || nm!=n-2)
        for(int i=ind+1;i<n-1;i++){
            if(ar[i+1]<ar[i]){
                continue;
            }
            if(ar[i+1]>ar[i]){
              flag3=1;
              ind1=i;
              break;
            }
        }
        if(flag2==1 && flag3==1 && flag1==0){
            int no=(ind1-ind)/2;

            for (int i = 0; i < no+1; i++) {
                int temp = ar[ind + i];
                ar[ind + i] = ar[ind1 - i];
                ar[ind1-i]=temp;

            }

        }
        if(flag2==1 && flag3==0 && flag1==0){
            int no=(n-ind)/2;
            for (int i = 0; i < no; i++) {
                int temp = ar[ind + i];
                ar[ind + i] = ar[n-1 - i];
                ar[n-1-i]=temp;
            }

        }
        if(flag2==1 && flag3==0 &&flag1==1){
            int no=(n-ind)/2;
            for (int i = 0; i < no; i++) {
                int temp = ar[ind + i];
                ar[ind + i] = ar[n-1 - i];
                ar[n-1-i]=temp;

            }

        }
        int c=0;
        for(int i=0;i<n-1;i++){
            if(ar[i+1]>ar[i]){
                c++;
            }
        }

        if(flag1==1&&flag2==0&&flag3==0 && c==n-1){
            System.out.println("yes");
            System.out.println("1 1");
            return;
        }
        if(flag1==0&&flag2==1&&flag3==0 && c==n-1){

            System.out.println("yes");
            System.out.println((ind+1)+" "+n);
            return;
        }
        if(flag1==0&&flag2==1&&flag3==1 && c==n-1){

            System.out.println("yes");
            System.out.println((ind+1)+" "+(ind1+1));
            return;
        }
        if(flag1==1&&flag2==1&&flag3==1 && c==n-1){

            System.out.println("yes");
            System.out.println((ind+1)+" "+(ind1+1));
            return;
        }
        if(flag1==1&&flag2==1&&flag3==0 && c==n-1){

            System.out.println("yes");
            System.out.println((ind+1)+" "+ (n));
            return;
        }

        System.out.println("no");
    }
}


import java.util.*;
import java.io.*;
import java.lang.*;

public class sortArray {
    public static void main(String args[]){
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int ar[]=new int[n];
        for(int i=0;i<n;i++){
            ar[i]=sc.nextInt();
        }
        int ind=0,ind1=0,flag1=0,flag2=0,flag3=0;
        for(int i=0;i<n-1;i++){
            if(ar[i+1]>ar[i]){
                flag1=1;
                continue;
            }
            if(ar[i+1]<ar[i]){
                ind=i;
                flag2=1;
                break;
            }
        }
        if(flag1!=1)
        for(int i=ind+1;i<n-1;i++){
            if(ar[i+1]<ar[i]){
                continue;
            }
            if(ar[i+1]>ar[i]){
              flag3=1;
              ind1=i;
              break;
            }
        }
        if(flag1==1&&flag2==0&&flag3==0){
            System.out.println("yes");
            System.out.println("1 1");
            return;
        }
        if(flag1==0&&flag2==1&&flag3==0){

            System.out.println("yes");
            System.out.println((ind+1)+" "+n);
            return;
        }
        if(flag1==0&&flag2==1&&flag3==1){

            System.out.println("yes");
            System.out.println((ind+1)+" "+(ind1+1));
            return;
        }
        System.out.println("no");
    }
}


import java.util.*;
import java.io.*;
import java.lang.*;

public class sortArray {

    public static void main(String args[]){
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int ar[]=new int[n];
        for(int i=0;i<n;i++){
            ar[i]=sc.nextInt();
        }
        int nm=0,ind=0,ind1=0,flag1=0,flag2=0,flag3=0;
        for(int i=0;i<n-1;i++){
            if(ar[i+1]>ar[i]){
                flag1=1;
                continue;
            }
            if(ar[i+1]<ar[i]){
                ind=i;
                flag2=1;
                break;
            }
            nm=i;
        }
        if(flag1!=1 || nm!=n-1)
        for(int i=ind+1;i<n-1;i++){
            if(ar[i+1]<ar[i]){
                continue;
            }
            if(ar[i+1]>ar[i]){
              flag3=1;
              ind1=i;
              break;
            }
        }
        if(flag2==1 && flag3==1){
            int no=(ind1-ind)/2;

            for (int i = 0; i < no+1; i++) {
                int temp = ar[ind + i];
                ar[ind + i] = ar[ind1 - i];
                ar[ind1-i]=temp;

            }

        }
        if(flag2==1 && flag3==0){
            int no=(n-ind)/2;
            for (int i = 0; i < no; i++) {
                int temp = ar[ind + i];
                ar[ind + i] = ar[n-1 - i];
                ar[n-1-i]=temp;
            }

        }
        int c=0;
        for(int i=0;i<n-1;i++){

            if(ar[i+1]>ar[i]){
                c++;
            }
        }

        if(flag1==1&&flag2==0&&flag3==0 && c==n-1){
            System.out.println("yes");
            System.out.println("1 1");
            return;
        }
        if(flag1==0&&flag2==1&&flag3==0 && c==n-1){

            System.out.println("yes");
            System.out.println((ind+1)+" "+n);
            return;
        }
        if(flag1==0&&flag2==1&&flag3==1 && c==n-1){

            System.out.println("yes");
            System.out.println((ind+1)+" "+(ind1+1));
            return;
        }
        if(flag1==1&&flag2==1&&flag3==1 && c==n-1){

            System.out.println("yes");
            System.out.println((ind+1)+" "+(ind1+1));
            return;
        }
        System.out.println("no");
    }
}


import java.util.*;
import java.io.*;
import java.lang.*;

public class sortArray {

    public static void main(String args[]){
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int ar[]=new int[n];
        for(int i=0;i<n;i++){
            ar[i]=sc.nextInt();
        }
        int ind=0,ind1=0,flag1=0,flag2=0,flag3=0;
        for(int i=0;i<n-1;i++){
            if(ar[i+1]>ar[i]){
                flag1=1;
                continue;
            }
            if(ar[i+1]<ar[i]){
                ind=i;
                flag2=1;
                break;
            }
        }
        if(flag1!=1)
        for(int i=ind+1;i<n-1;i++){
            if(ar[i+1]<ar[i]){
                continue;
            }
            if(ar[i+1]>ar[i]){
              flag3=1;
              ind1=i;
              break;
            }
        }
        if(flag2==1 && flag3==1){
            int no=(ind1-ind)/2;

            for (int i = 0; i < no+1; i++) {
                int temp = ar[ind + i];
                ar[ind + i] = ar[ind1 - i];
                ar[ind1-i]=temp;

            }

        }
        if(flag2==1 && flag3==0){
            int no=(n-ind)/2;
            for (int i = 0; i < no; i++) {
                int temp = ar[ind + i];
                ar[ind + i] = ar[n-1 - i];
                ar[n-1-i]=temp;
            }

        }
        int c=0;
        for(int i=0;i<n-1;i++){
           // System.out.println(ar[i]);
            if(ar[i+1]>ar[i]){
                c++;
            }
        }

        if(flag1==1&&flag2==0&&flag3==0 && c==n-1){
            System.out.println("yes");
            System.out.println("1 1");
            return;
        }
        if(flag1==0&&flag2==1&&flag3==0 && c==n-1){

            System.out.println("yes");
            System.out.println((ind+1)+" "+n);
            return;
        }
        if(flag1==0&&flag2==1&&flag3==1 && c==n-1){

            System.out.println("yes");
            System.out.println((ind+1)+" "+(ind1+1));
            return;
        }
        System.out.println("no");
    }
}


import java.io.*;
import java.util.*;
import java.lang.*;

public class sortArray{
    public static void main(String args[]){
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int ar[]=new int[n];
        for(int i=0;i<n;i++){
            ar[i]=sc.nextInt();
        }
        int ind1=0,ind2=0;
        for(int i=0;i<n-1;i++){
            if(ar[i+1]<ar[i]){
              ind1=i;
              break;
            }
        }

        for(int i=n-1;i>0;i--){
            if(ar[i]<ar[i-1]){
                ind2=i;
                break;
            }
        }

        int no=(ind2-ind1)/2;
        for(int i=0;i<no+1;i++){
            int temp=ar[ind1+i];
            ar[ind1+i]=ar[ind2-i];
            ar[ind2-i]=temp;
        }
        int c=1;
        for(int i=0;i<n-1;i++){

            if(ar[i+1]>ar[i]){
                c++;
            }
        }
        if(c==n){
            System.out.println("yes");
            System.out.println((ind1+1)+" "+(ind2+1));
            return;
        }
        System.out.println("no");
    }
}


import java.util.*;
import java.io.*;
import java.lang.*;

public class sortArray {

    public static void main(String args[]){
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int ar[]=new int[n];
        for(int i=0;i<n;i++){
            ar[i]=sc.nextInt();
        }
        int nm=0,ind=0,ind1=0,flag1=0,flag2=0,flag3=0;
        for(int i=0;i<n-1;i++){
            if(ar[i+1]>ar[i]){
                flag1=1;
                nm=i;
                continue;
            }
            if(ar[i+1]<ar[i]){
                ind=i;
                flag2=1;
                break;
            }
            nm=i;
        }
        if(flag1!=1 || nm!=n-2)
        for(int i=ind+1;i<n-1;i++){
            if(ar[i+1]<ar[i]){
                continue;
            }
            if(ar[i+1]>ar[i]){
              flag3=1;
              ind1=i;
              break;
            }
        }
        if(flag2==1 && flag3==1){
            int no=(ind1-ind)/2;

            for (int i = 0; i < no+1; i++) {
                int temp = ar[ind + i];
                ar[ind + i] = ar[ind1 - i];
                ar[ind1-i]=temp;

            }

        }
        if(flag2==1 && flag3==0){
            int no=(n-ind)/2;
            for (int i = 0; i < no; i++) {
                int temp = ar[ind + i];
                ar[ind + i] = ar[n-1 - i];
                ar[n-1-i]=temp;
            }

        }
        int c=0;
        for(int i=0;i<n-1;i++){

            if(ar[i+1]>ar[i]){
                c++;
            }
        }

        if(flag1==1&&flag2==0&&flag3==0 && c==n-1){
            System.out.println("yes");
            System.out.println("1 1");
            return;
        }
        if(flag1==0&&flag2==1&&flag3==0 && c==n-1){

            System.out.println("yes");
            System.out.println((ind+1)+" "+n);
            return;
        }
        if(flag1==0&&flag2==1&&flag3==1 && c==n-1){

            System.out.println("yes");
            System.out.println((ind+1)+" "+(ind1+1));
            return;
        }
        if(flag1==1&&flag2==1&&flag3==1 && c==n-1){

            System.out.println("yes");
            System.out.println((ind+1)+" "+(ind1+1));
            return;
        }
        System.out.println("no");
    }
}


import java.util.Arrays;
import java.util.HashMap;
import java.util.Scanner;

public class Sample_problem {

    public static void main(String args[]) {
        Scanner input = new Scanner(System.in);
        int n = input.nextInt();
        int arr[] = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = input.nextInt();
        }
        int l = 0;
        int r = n - 1;
        boolean correct = true;
        while (l < n - 1 && arr[l] < arr[l + 1]) {
            l++;
        }
      // System.out.println(l);
        while (r > 0 && arr[r] > arr[r - 1]) {
            r--;
         }
       //System.out.println(r);
        //System.out.println(arr[24]);
       // System.out.println(arr[36]);
        if (l + 1 == r) {
            int temp=arr[l];
            arr[l]=arr[r];
            arr[r]=temp;
        } else {
            int j=0;
           // System.out.println("lefttt "+l);
            //System.out.println("right  "+r);
            int s=l;
            for (int i = 0; i <=(r-l) / 2; i++) {
               // System.out.println(arr[s]+"        "+arr[r-j]);
                int temp = arr[s];
                arr[s] = arr[r - j];
                arr[r - j] = temp;
                j++;
                s++;
            }
        }
       //System.out.println(Arrays.toString(arr));
        if (!is_sorted(arr)) {
            correct = false;
        }
        if (correct) {
            System.out.println("yes");
            if (l != n - 1) {
                System.out.println((l + 1) + " " + (r + 1));
            } else {
                System.out.println("1 1");
            }
        } else {
            System.out.println("no");
        }
    }

    private static boolean is_sorted(int arr[]) {
        for (int i = 0; i < arr.length - 1; i++) {
            if (arr[i] > arr[i + 1]) {
                return false;
            }
        }
        return true;
    }
}


import java.util.Arrays;
import java.util.HashMap;
import java.util.Scanner;

public class Sample_problem {

    public static void main(String args[]) {
        Scanner input = new Scanner(System.in);
        int n = input.nextInt();
        int arr[] = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = input.nextInt();
        }
        int l = 0;
        int r = n - 1;
        boolean correct = true;
        while (l < n - 1 && arr[l] < arr[l + 1]) {
            l++;
        }
        //System.out.println(l);
        while (r > 0 && arr[r] > arr[r - 1]) {
            r--;
        }
        //System.out.println(r);
        for (int i = l; i < r ; i++) {
            int temp = arr[i];
            arr[i] = arr[r - i];
            arr[r - i] = temp;
        }
       // System.out.println(Arrays.toString(arr));
        if(!is_sorted(arr)){correct=false;}
        if (correct) {
            System.out.println("yes");
            if (l != n - 1) {
                System.out.println((l + 1) + " " + (r + 1));
            } else {
                System.out.println("1 1");
            }
        } else {
            System.out.println("no");
        }
    }

    private static boolean is_sorted(int arr[]) {
        for (int i = 0; i < arr.length - 1; i++) {
            if (arr[i] > arr[i + 1]) {
                return false;
            }
        }
        return true;
    }
}


import java.util.Arrays;
import java.util.HashMap;
import java.util.Scanner;

public class Sample_problem {

    public static void main(String args[]) {
        Scanner input = new Scanner(System.in);
        int n = input.nextInt();
        int arr[] = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = input.nextInt();
        }
        int l = 0;
        int r = n - 1;
        boolean correct = true;
        while (l < n - 1 && arr[l] < arr[l + 1]) {
            l++;
        }
       // System.out.println(l);
        while (r > 0 && arr[r] > arr[r - 1]) {
            r--;
        }
     //  System.out.println(r);
        if (l + 1 == r) {
            int temp=arr[l];
            arr[l]=arr[r];
            arr[r]=temp;
        } else {
            int j=0;
            for (int i = l; i <=r / 2; i++) {
                int temp = arr[i];
                arr[i] = arr[r - j];
                arr[r - j] = temp;
                j++;
            }
        }
      // System.out.println(Arrays.toString(arr));
        if (!is_sorted(arr)) {
            correct = false;
        }
        if (correct) {
            System.out.println("yes");
            if (l != n - 1) {
                System.out.println((l + 1) + " " + (r + 1));
            } else {
                System.out.println("1 1");
            }
        } else {
            System.out.println("no");
        }
    }

    private static boolean is_sorted(int arr[]) {
        for (int i = 0; i < arr.length - 1; i++) {
            if (arr[i] > arr[i + 1]) {
                return false;
            }
        }
        return true;
    }
}


import java.util.Arrays;
import java.util.HashMap;
import java.util.Scanner;

public class Sample_problem {

    public static void main(String args[]) {
        Scanner input = new Scanner(System.in);
        int n = input.nextInt();
        int arr[] = new int[n];
        int arr_s[]=new int [n];
        for (int i = 0; i < n; i++) {
            arr[i] = input.nextInt();
            arr_s[i]=arr[i];
        }
        int l=0, r = 0;
        boolean yes = false;
        if (is_sorted(arr)) {
            l = r = 1;
            yes = true;

        } else {
            Arrays.sort(arr_s);
            int first_swap=-1,second_swap=-1;
            for(int i=0;i<arr.length;i++){
                if(arr[i]!=arr_s[i]){
                    if(first_swap==-1){
                        first_swap=i;
                    }else{
                        if( second_swap==-1&&(arr[first_swap]!=arr_s[i]||arr_s[first_swap]!=arr[i])){
                            second_swap=1;
                            yes=false;
                            break;
                        }else{
                          l=first_swap+1;
                          r=i+1;
                          yes=true;
                        }
                    }
                }
            }

        }
        if(yes){
            System.out.println("yes");
            System.out.println(l+" "+r);
        }else{
            System.out.println("no");
        }

    }

    public static boolean is_sorted(int arr[]) {
        for (int i = 0; i < arr.length - 1; i++) {
            if (arr[i] > arr[i + 1]) {
                return false;
            }
        }
        return true;
    }
}


public class Sample_problem {

    public static void main(String args[]) {
        Scanner input = new Scanner(System.in);
        int n = input.nextInt();
        int arr[] = new int[n];
        int arr_s[]=new int [n];
        for (int i = 0; i < n; i++) {
            arr[i] = input.nextInt();
            arr_s[i]=arr[i];
        }
        int l=0, r = 0;
        boolean yes = false;
        if (is_sorted(arr)) {
            l = r = 1;
            yes = true;

        } else {
            Arrays.sort(arr_s);
            int first_swap=-1,second_swap=-1;
            for(int i=0;i<arr.length;i++){
                if(arr[i]!=arr_s[i]){
                    if(first_swap==-1){
                        first_swap=i;
                    }else{
                        if( second_swap==-1&&(arr[first_swap]!=arr_s[i]||arr_s[first_swap]!=arr[i])){
                            second_swap=1;
                            yes=false;
                            break;
                        }else{
                          l=first_swap+1;
                          r=i+1;
                          yes=true;
                        }
                    }
                }
            }

        }
        if(yes){
            System.out.println("yes");
            System.out.println(l+" "+r);
        }else{
            System.out.println("no");
        }

    }

    public static boolean is_sorted(int arr[]) {
        for (int i = 0; i < arr.length - 1; i++) {
            if (arr[i] > arr[i + 1]) {
                return false;
            }
        }
        return true;
    }
}


import java.util.Arrays;
import java.util.HashMap;
import java.util.Scanner;

public class Sample_problem {

    public static void main(String args[]) {
        Scanner input = new Scanner(System.in);
        int n = input.nextInt();
        int arr[] = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = input.nextInt();
        }
        if (is_sorted(arr)) {
            System.out.println("yes");
            System.out.println("1 1");
        } else {
            int l = 0;
            int r = n - 1;
            boolean correct = true;
            while (l < n - 1 && arr[l] < arr[l + 1]) {
                l++;
            }
            // System.out.println(l);
            while (r > 0 && arr[r] > arr[r - 1]) {
                r--;
            }
       //System.out.println(r);
            //System.out.println(arr[24]);
            // System.out.println(arr[36]);
            if (l + 1 == r) {
                int temp = arr[l];
                arr[l] = arr[r];
                arr[r] = temp;
            } else {
                int j = 0;
           // System.out.println("lefttt "+l);
                //System.out.println("right  "+r);
                int s = l;
                for (int i = 0; i <= (r - l) / 2; i++) {
                    // System.out.println(arr[s]+"        "+arr[r-j]);
                    int temp = arr[s];
                    arr[s] = arr[r - j];
                    arr[r - j] = temp;
                    j++;
                    s++;
                }
            }
            //System.out.println(Arrays.toString(arr));
            if (!is_sorted(arr)) {
                correct = false;
            }
            if (correct) {
                System.out.println("yes");
                if (l != n - 1) {
                    System.out.println((l + 1) + " " + (r + 1));
                } else {
                    System.out.println("1 1");
                }
            } else {
                System.out.println("no");
            }
        }
    }

    private static boolean is_sorted(int arr[]) {
        for (int i = 0; i < arr.length - 1; i++) {
            if (arr[i] > arr[i + 1]) {
                return false;
            }
        }
        return true;
    }
}


import java.util.Arrays;
import java.util.HashMap;
import java.util.Scanner;

public class Sample_problem {

    public static void main(String args[]) {
        Scanner input = new Scanner(System.in);
        int n = input.nextInt();
        int arr[] = new int[n];
        int arr_s[] = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = input.nextInt();
            arr_s[i] = arr[i];
        }

        int l = 0, r = 0;
        boolean yes = false;
        if (is_sorted(arr)) {
            l = r = 1;
            yes = true;

        } else {
            if (reverse_array(arr)) {
                yes = true;
                l = 1;
                r = arr.length;

            } else {
                Arrays.sort(arr_s);
                int first_swap = -1, second_swap = -1;
                for (int i = 0; i < arr.length; i++) {
                    if (arr[i] != arr_s[i]) {
                        if (first_swap == -1) {
                            first_swap = i;
                        } else {
                            if (second_swap == -1 && (arr[first_swap] != arr_s[i] || arr_s[first_swap] != arr[i])) {
                                second_swap = 1;
                                yes = false;
                                break;
                            } else {
                                l = first_swap + 1;
                                r = i + 1;
                                yes = true;
                            }
                        }
                    }
                }
            }
        }
        if (yes) {
            System.out.println("yes");
            System.out.println(l + " " + r);
        } else {
            System.out.println("no");
        }

    }

    public static boolean is_sorted(int arr[]) {
        for (int i = 0; i < arr.length - 1; i++) {
            if (arr[i] > arr[i + 1]) {
                return false;
            }
        }
        return true;
    }

    public static boolean reverse_array(int array[]) {
        for (int i = 0; i < array.length - 1; i++) {
            if (array[i] < array[i + 1]) {
                return false;
            }
        }
        return true;

    }
}


import java.util.Arrays;
import java.util.HashMap;
import java.util.Scanner;

public class Sample_problem {

    public static void main(String args[]) {
        Scanner input = new Scanner(System.in);
        int n = input.nextInt();
        int arr[] = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = input.nextInt();
        }
        int l = 0;
        int r = n - 1;
        boolean correct = true;
        while (l < n - 1 && arr[l] < arr[l + 1]) {
            l++;
        }
        //System.out.println(l);
        while (r > 0 && arr[r] > arr[r - 1]) {
            r--;
        }
       // System.out.println(r);
        if (l + 1 == r) {
            int temp=arr[l];
            arr[l]=arr[r];
            arr[r]=temp;
        } else {
            for (int i = l; i < r / 2; i++) {
                int temp = arr[i];
                arr[i] = arr[r - i];
                arr[r - i] = temp;
            }
        }
       // System.out.println(Arrays.toString(arr));
        if (!is_sorted(arr)) {
            correct = false;
        }
        if (correct) {
            System.out.println("yes");
            if (l != n - 1) {
                System.out.println((l + 1) + " " + (r + 1));
            } else {
                System.out.println("1 1");
            }
        } else {
            System.out.println("no");
        }
    }

    private static boolean is_sorted(int arr[]) {
        for (int i = 0; i < arr.length - 1; i++) {
            if (arr[i] > arr[i + 1]) {
                return false;
            }
        }
        return true;
    }


import java.util.Arrays;
import java.util.HashMap;
import java.util.Scanner;

public class Sample_problem {

    public static void main(String args[]) {
        Scanner input = new Scanner(System.in);
        int n = input.nextInt();
        int arr[] = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = input.nextInt();
        }
        int l = 0;
        int r = n - 1;
        boolean correct = true;
        while (l < n - 1 && arr[l] < arr[l + 1]) {
            l++;
        }
        //System.out.println(l);
        while (r > 0 && arr[r] > arr[r - 1]) {
            r--;
        }
       // System.out.println(r);
        if (l + 1 == r) {
            int temp=arr[l];
            arr[l]=arr[r];
            arr[r]=temp;
        } else {
            for (int i = l; i < r / 2; i++) {
                int temp = arr[i];
                arr[i] = arr[r - i];
                arr[r - i] = temp;
            }
        }
       // System.out.println(Arrays.toString(arr));
        if (!is_sorted(arr)) {
            correct = false;
        }
        if (correct) {
            System.out.println("yes");
            if (l != n - 1) {
                System.out.println((l + 1) + " " + (r + 1));
            } else {
                System.out.println("1 1");
            }
        } else {
            System.out.println("no");
        }
    }

    private static boolean is_sorted(int arr[]) {
        for (int i = 0; i < arr.length - 1; i++) {
            if (arr[i] > arr[i + 1]) {
                return false;
            }
        }
        return true;
    }
}


import java.util.Arrays;
import java.util.HashMap;
import java.util.Scanner;

public class Sample_problem {

    public static void main(String args[]) {
        Scanner input = new Scanner(System.in);
        int n = input.nextInt();
        int arr[] = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = input.nextInt();
        }
        int l = 0;
        int r = n - 1;
        boolean correct = true;
        while (l < n-1 && arr[l] < arr[l + 1]) {
            l++;
        }
        while (r > 0 && arr[r] > arr[r - 1]) {
            r--;
        }
        for (int i = l; i < r; i++) {
            if (arr[i] < arr[i + 1]) {
                correct = false;
                break;
            }
        }
        if(correct){
            System.out.println("yes");
            if(l!=n-1)
            System.out.println((l+1)+" "+(r+1));
            else
                System.out.println("1 1");
        }else{
            System.out.println("no");
        }
    }
}


import java.util.Arrays;
import java.util.HashMap;
import java.util.Scanner;

public class Sample_problem {

    public static void main(String args[]) {
        Scanner input = new Scanner(System.in);
        int n = input.nextInt();
        int arr[] = new int[n];
        int arr_s[] = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = input.nextInt();
            arr_s[i] = arr[i];
        }

        int l = 0, r = 0;
        boolean yes = false;
        if (is_sorted(arr)) {
            l = r = 1;
            yes = true;

        } else {
            if (reverse_array(arr)) {
                yes = true;
                l = 1;
                r = arr.length;

            } else {
                Arrays.sort(arr_s);
                int first_swap = -1, second_swap = -1;
                for (int i = 0; i < arr.length; i++) {
                    if (arr[i] != arr_s[i]) {
                        if (first_swap == -1) {
                            first_swap = i;
                        } else {
                            if (second_swap == -1 && (arr[first_swap] != arr_s[i] || arr_s[first_swap] != arr[i])) {
                                second_swap = 1;
                                yes = false;
                                break;
                            } else {
                                l = first_swap + 1;
                                r = i + 1;
                                yes = true;
                            }
                        }
                    }
                }
            }
        }
        if (yes) {
            System.out.println("yes");
            System.out.println(l + " " + r);
        } else {
            System.out.println("no");
        }

    }

    public static boolean is_sorted(int arr[]) {
        for (int i = 0; i < arr.length - 1; i++) {
            if (arr[i] > arr[i + 1]) {
                return false;
            }
        }
        return true;
    }

    public static boolean reverse_array(int array[]) {
        for (int i = 0; i < array.length - 1; i++) {
            if (array[i] < array[i + 1]) {
                return false;
            }
        }
        return true;

    }


import java.util.Arrays;
import java.util.Scanner;

public class Main {
    private static final Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        int n = sc.nextInt();
        Integer[] arr = new Integer[n];
        for (int i = 0; i < n; i++) {
            arr[i] = sc.nextInt();
        }
        int i = 0, j = n - 1;
        while (i < n - 1) {
            i++;
            if (arr[i-1] > arr[i]) {
                if (i == 1) i = 0;
                break;
            }
        }
        while (j > 0) {
            if (arr[j - 1] > arr[j]) break;
            j--;
        }
        if (i >= j) {
            System.out.println("yes");
            System.out.println("1 1");
        } else {
            Arrays.sort(arr, i, j + 1);
            for (int index = 0; index < n - 1; index++) {
                if (arr[index] > arr[index + 1]) {
                    System.out.println("no");
                    return;
                }
            }
            System.out.println("yes");
            System.out.println((i + 1) + " " + (j + 1));
        }
    }
}


import java.util.Arrays;
import java.util.Scanner;

public class Main {
    private static final Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        int n = sc.nextInt();
        Integer[] arr = new Integer[n];
        for (int i = 0; i < n; i++) {
            arr[i] = sc.nextInt();
        }
        int i = 0, j = n - 1;
        while (i < n - 1) {
            if (arr[i] > arr[i + 1]) break;
            i++;
        }
        while (j > 0) {
            if (arr[j - 1] > arr[j]) break;
            j--;
        }
        if (i >= j) {
            System.out.println("yes");
            System.out.println("1 1");
        } else {
            Arrays.sort(arr, i, j + 1);
            for (int index = 0; index < n - 1; index++) {
                if (arr[index] > arr[index + 1]) {
                    System.out.println("no");
                    return;
                }
            }
            System.out.println("yes");
            System.out.println((i + 1) + " " + (j + 1));
        }
    }
}


import java.util.Arrays;
import java.util.Scanner;

public class Main {
    private static final Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        int n = sc.nextInt();
        Integer[] arr = new Integer[n];
        for (int i = 0; i < n; i++) {
            arr[i] = sc.nextInt();
        }
        int i = 0, j = n - 1;
        while (i < n - 1) {
            i++;
            if (arr[i-1] > arr[i]) break;
        }
        while (j > 0) {
            if (arr[j - 1] > arr[j]) break;
            j--;
        }
        if (i >= j) {
            System.out.println("yes");
            System.out.println("1 1");
        } else {
            Arrays.sort(arr, i, j + 1);
            for (int index = 0; index < n - 1; index++) {
                if (arr[index] > arr[index + 1]) {
                    System.out.println("no");
                    return;
                }
            }
            System.out.println("yes");
            System.out.println((i + 1) + " " + (j + 1));
        }
    }
}


import java.util.Arrays;
import java.util.Scanner;

public class Main {
    private static final Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        int n = sc.nextInt();
        Integer[] arr = new Integer[n];
        for (int i = 0; i < n; i++) {
            arr[i] = sc.nextInt();
        }
        Integer[] sortedArr = arr.clone();
        Arrays.sort(sortedArr);
        int l = 0, r = 0;
        for (int i = 0; i < n; i++) {
            if (arr[i] == sortedArr[i]) continue;
            l = i;
            break;
        }

        for (int i = l; i < n; i++) {
            if (arr[i] == sortedArr[i]) continue;
            r = i;
        }
        for (int i = 0; i < r - l; i++) {
            if (arr[l + i] == sortedArr[r - i]) continue;
            System.out.println("no");
            return;
        }
        System.out.println("yes");
        System.out.println((l + 1) + " " + (r + 1));
    }
}


import java.util.Arrays;
import java.util.Scanner;

public class Main {
    private static final Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        int n = sc.nextInt();
        Integer[] arr = new Integer[n];
        for (int i = 0; i < n; i++) {
            arr[i] = sc.nextInt();
        }
        int i = 0, j = n - 1;
        while (i < n-1) {
            if (arr[i] > arr[i + 1]) break;
            i++;
        }
        while (j > 0) {
            if (arr[j - 1] > arr[j]) break;
            j--;
        }
        if (i >= j) {
            System.out.println("yes");
            System.out.println("1 1");
        } else {
            Arrays.sort(arr, i, j + 1);
            for (int index = 0; index < n - 1; index++) {
                if (arr[index] > arr[index + 1]) {
                    System.out.println("no");
                    return;
                }
            }
            System.out.println("yes");
            System.out.println((i + 1) + " " + (j + 1));
        }
    }
}


import java.util.Arrays;
import java.util.Scanner;

public class Main {
    private static final Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        int n = sc.nextInt();
        Integer[] arr = new Integer[n];
        for (int i = 0; i < n; i++) {
            arr[i] = sc.nextInt();
        }
        Integer[] sortedArr = arr.clone();
        Arrays.sort(sortedArr);
        int l = 0;
        for (; l < n; l++) {
            if (arr[l] != sortedArr[l]) {
                break;
            }
        }
        int r = l;
        for (; r < n; r++) {
            if (arr[r]==sortedArr[r]){
                break;
            }
        }
        for (int i = 0; i < r-l; i++) {
            if (arr[l+i] != sortedArr[r-i]) {
                System.out.println("no");
                return;
            }
        }
        System.out.println("yes");
        System.out.println((l + 1) + " " + (r + 1));
    }
}


import java.util.Arrays;
import java.util.Scanner;

public class Main {
    private static final Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        int n = sc.nextInt();
        Integer[] arr = new Integer[n];
        for (int i = 0; i < n; i++) {
            arr[i] = sc.nextInt();
        }
        Integer[] sortedArr = arr.clone();
        Arrays.sort(sortedArr);
        int l = 0, r = 0;
        for (int i = 0; i < n; i++) {
            if (arr[i] == sortedArr[i]) continue;
            l = i;
            break;
        }

        for (int i = l; i < n; i++) {
            if (arr[i] == sortedArr[i]) continue;
            r = i;
        }
        for (int i = 0; i < r - l; i++) {
            if (arr[l + i] != sortedArr[r - i]) {
                System.out.println("no");
                return;
            }
        }
        System.out.println("yes");
        System.out.println((l + 1) + " " + (r + 1));
    }
}


import java.util.*;

public class Main {

    public static int[] reverseSection(int[] array, int l, int r) {
        int tmp = 0;
        for (int i = 0; i <= (r - l)/2; i++) {
            tmp = array[l+i];
            array[l+i] = array[r-i];
            array[r-i] = tmp;
        }
//        for (int el : array) {
//            System.out.print("  l: " + l + ", r: " + r + ", el: " + el);
//        }
        return array;
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        in.nextLine();

        int[] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = in.nextInt();
        }

        int[] sortedArray = a.clone(); //Arrays.copyOf(a, a.length);
        int[] tmpArray = a.clone();
        Arrays.sort(sortedArray);

        int start = 0, end = 0;
        for (int i = 0; i < n - 1; i++) {
            if (a[i] > a[i + 1]) {
                start = i;
                break;
            }
        }

        for (int i = start; i < n - 1; i++) {
            if (a[i] < a[i + 1]) {
                end = i;
                break;
            }
            end = n - 1;
        }

        boolean sorted = false;
        int l, r = 0;
        label:
        for (l = start; l < n && l <= r; l++) {
            for (r = end; r < n && r >= l; r--) {
                Arrays.sort(tmpArray, l, r + 1);

//                for (int el : tmpArray) {
//                    System.out.print("  l: " + l + ", r: " + r + ", el: " + el);
//                }

                if (Arrays.equals(tmpArray, sortedArray)) {
                    sorted = true;
                    break label;
                }
//                if (a[l] == sortedArray[r] && a[r] == sortedArray[l] && sorted) {
//                    break label;
//                }

//               if (Arrays.equals(reverseSection(Arrays.copyOf(a, a.length), l, r), sortedArray)) {
//                   sorted = true;
//                   break label;
//               }
            }
//            index++;
        }

        if (sorted) {
            System.out.printf("yes\n%d %d\n", l + 1, r + 1);
        } else {
            System.out.println("no");
        }
    }
}


import java.util.*;

public class Main {

    public static int[] reverseSection(int[] array, int l, int r) {
        int tmp = 0;
//        for (int el : array) {
//            System.out.print("  аргумент: ");
//            System.out.print("  " + el);
//        }
        for (int i = 0; i <= (r - l)/2; i++) {
            tmp = array[l+i];
            array[l+i] = array[r-i];
            array[r-i] = tmp;
        }
//        for (int el : array) {
//            System.out.print("  l: " + l + ", r: " + r + ", el: " + el);
//        }
        return array;
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        in.nextLine();

        int[] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = in.nextInt();
        }

        int[] sortedArray = Arrays.copyOf(a, a.length);
        Arrays.sort(sortedArray);
//        for (int el : sortedArray) {
//            System.out.println(el);
//        }
        for (int l = 0; l < n; l++) {
            for (int r = 0; r < n; r++) {
               if (Arrays.equals(reverseSection(Arrays.copyOf(a, a.length), l, r), sortedArray)) {
                   System.out.println("YES");
                   System.out.println(l + 1 + " " + (r + 1));
                   System.exit(0);
               }
            }
        }

        System.out.println("NO");
        System.exit(0);
    }
}


import java.util.*;

public class Main {

    public static int[] reverseSection(int[] array, int l, int r) {
        int tmp = 0;
        for (int i = 0; i <= (r - l)/2; i++) {
            tmp = array[l+i];
            array[l+i] = array[r-i];
            array[r-i] = tmp;
        }
//        for (int el : array) {
//            System.out.print("  l: " + l + ", r: " + r + ", el: " + el);
//        }
        return array;
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        in.nextLine();

        int[] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = in.nextInt();
        }

        int[] sortedArray = a.clone(); //Arrays.copyOf(a, a.length);
//        int[] tmpArray = a.clone();
        Arrays.sort(sortedArray);

        boolean sorted = false;
        int l, r = 0, index = 0;
        label:
        for (l = 0; l < n && l <= r; l++) {
            if (Arrays.equals(a, sortedArray)) {
                sorted = true;
                l = r = 0;
                break;
            }
            for (r = index; r < n && r >= l; r++) {
//                int tmp = 0;
//                for (int i = 0; i <= (r - l)/2; i++) {
//                    tmp = tmpArray[l+i];
//                    tmpArray[l+i] = tmpArray[r-i];
//                    tmpArray[r-i] = tmp;

//                    if (a[l+i] != sortedArray[r-i]) {
//                        sorted = false;
//                    }
//                }

                int i = 0;
                while (a[l] > a[l+i] && i < r) {
                    sorted = true;
                    i++;
                }
                if (a[l] == sortedArray[r] && sorted) {
                    break label;
                }

//                for (int el : tmpArray) {
//                    System.out.print("  l: " + l + ", r: " + r + ", el: " + el);
//                }

//                if (Arrays.equals(tmpArray, sortedArray)) {
//                    sorted = true;
//                    break label;
//                }

//               if (Arrays.equals(reverseSection(Arrays.copyOf(a, a.length), l, r), sortedArray)) {
//                   sorted = true;
//                   break label;
//               }
            }
            index++;
        }

        if (sorted) {
            System.out.printf("yes\n%d %d\n", l + 1, r + 1);
        } else {
            System.out.println("no");
        }
    }
}


import java.util.*;

public class Main {

    public static int[] reverseSection(int[] array, int l, int r) {
        int tmp = 0;
        for (int i = 0; i <= (r - l)/2; i++) {
            tmp = array[l+i];
            array[l+i] = array[r-i];
            array[r-i] = tmp;
        }
//        for (int el : array) {
//            System.out.print("  l: " + l + ", r: " + r + ", el: " + el);
//        }
        return array;
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        in.nextLine();

        int[] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = in.nextInt();
        }

        int[] sortedArray = a.clone(); //Arrays.copyOf(a, a.length);
//        int[] tmpArray = a.clone();
        Arrays.sort(sortedArray);
//        for (int el : sortedArray) {
//            System.out.println(el);
//        }
        boolean sorted = false;
        int l, r = 0, index = 0;
        label:
        for (l = 0; l < n && l <= r; l++) {
            if (Arrays.equals(a, sortedArray)) {
                sorted = true;
                l = r = 0;
                break;
            }
            for (r = index; r < n && r >= l; r++) {
//                int tmp = 0;
//                for (int i = 0; i <= (r - l)/2; i++) {
//                    tmp = tmpArray[l+i];
//                    tmpArray[l+i] = tmpArray[r-i];
//                    tmpArray[r-i] = tmp;

//                    if (a[l+i] != sortedArray[r-i]) {
//                        sorted = false;
//                    }
//                }

                if (a[l] == sortedArray[r] && a[l] > a[l+1]) {
                    sorted = true;
                    break label;
                }

//                for (int el : tmpArray) {
//                    System.out.print("  l: " + l + ", r: " + r + ", el: " + el);
//                }

//                if (Arrays.equals(tmpArray, sortedArray)) {
//                    sorted = true;
//                    break label;
//                }

//               if (Arrays.equals(reverseSection(Arrays.copyOf(a, a.length), l, r), sortedArray)) {
//                   sorted = true;
//                   break label;
//               }
            }
            index++;
        }

        if (sorted) {
            System.out.printf("yes\n%d %d\n", l + 1, r + 1);
        } else {
            System.out.println("no");
        }
    }
}


import java.util.*;

public class Main {

    public static int[] reverseSection(int[] array, int l, int r) {
        int tmp = 0;
//        for (int el : array) {
//            System.out.print("  аргумент: ");
//            System.out.print("  " + el);
//        }
        for (int i = 0; i <= (r - l)/2; i++) {
            tmp = array[l+i];
            array[l+i] = array[r-i];
            array[r-i] = tmp;
        }
//        for (int el : array) {
//            System.out.print("  l: " + l + ", r: " + r + ", el: " + el);
//        }
        return array;
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        in.nextLine();

        int[] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = in.nextInt();
        }

        int[] sortedArray = Arrays.copyOf(a, a.length);
        Arrays.sort(sortedArray);
//        for (int el : sortedArray) {
//            System.out.println(el);
//        }
        boolean sorted = false;
        int l, r = 0;
        label:
        for (l = 0; l < n; l++) {
            for (r = 0; r < n; r++) {
               if (Arrays.equals(reverseSection(Arrays.copyOf(a, a.length), l, r), sortedArray)) {
                   sorted = true;
                   break label;
//                   System.exit(0);
               }
            }
        }

        if (sorted) {
            System.out.printf("yes\n%d %d\n", l + 1, r + 1);
        } else {
            System.out.println("no");
        }
//        System.exit(0);
    }
}


import java.util.*;

public class Main {

    public static int[] reverseSection(int[] array, int l, int r) {
        int tmp = 0;
        for (int i = 0; i <= (r - l)/2; i++) {
            tmp = array[l+i];
            array[l+i] = array[r-i];
            array[r-i] = tmp;
        }
//        for (int el : array) {
//            System.out.print("  l: " + l + ", r: " + r + ", el: " + el);
//        }
        return array;
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        in.nextLine();

        int[] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = in.nextInt();
        }

        int[] sortedArray = a.clone(); //Arrays.copyOf(a, a.length);
        int[] tmpArray = a.clone();
        Arrays.sort(sortedArray);

        int start = 0, end = 0;
        for (int i = 0; i < n - 1; i++) {
            if (a[i] > a[i + 1]) {
                start = i;
                break;
            }
        }
//        System.out.println(start);
        for (int i = start; i < n - 1; i++) {
            if (a[i] < a[i + 1]) {
                end = i;
                break;
            }
            end = n - 1;
        }
//        System.out.println(end);

        boolean sorted = false;
        int l, r = end;
        label:
        for (l = start; l < n && l <= r; l++) {
            for (r = end; r < n && r >= l; r--) {
                Arrays.sort(tmpArray, l, r + 1);
//
//                for (int el : tmpArray) {
//                    System.out.print("  l: " + l + ", r: " + r + ", el: " + el);
//                }

                if (Arrays.equals(tmpArray, sortedArray)) {
                    sorted = true;
                    break label;
                }
//                if (a[l] == sortedArray[r] && a[r] == sortedArray[l] && sorted) {
//                    break label;
//                }

//               if (Arrays.equals(reverseSection(Arrays.copyOf(a, a.length), l, r), sortedArray)) {
//                   sorted = true;
//                   break label;
//               }
            }
//            index++;
        }

        if (sorted) {
            System.out.printf("yes\n%d %d\n", l + 1, r + 1);
        } else {
            System.out.println("no");
        }
    }
}


import java.util.*;

public class Main {

    public static int[] reverseSection(int[] array, int l, int r) {
        int tmp = 0;
//        for (int el : array) {
//            System.out.print("  аргумент: ");
//            System.out.print("  " + el);
//        }
        for (int i = 0; i <= (r - l)/2; i++) {
            tmp = array[l+i];
            array[l+i] = array[r-i];
            array[r-i] = tmp;
        }
//        for (int el : array) {
//            System.out.print("  l: " + l + ", r: " + r + ", el: " + el);
//        }
        return array;
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        in.nextLine();

        int[] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = in.nextInt();
        }

        int[] sortedArray = Arrays.copyOf(a, a.length);
        Arrays.sort(sortedArray);
//        for (int el : sortedArray) {
//            System.out.println(el);
//        }
        for (int l = 0; l < n; l++) {
            for (int r = 0; r < n; r++) {
               if (Arrays.equals(reverseSection(Arrays.copyOf(a, a.length), l, r), sortedArray)) {
                   System.out.println("yes");
                   System.out.println(l + 1 + " " + (r + 1));
                   System.exit(0);
               }
            }
        }

        System.out.println("no");
        System.exit(0);
    }
}


//package c;

//import java.util.Arrays;
import java.util.Scanner;

public class Solution {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner in = new Scanner(System.in);
		long n = in.nextLong();
		long[] ar = new long[(int)n];
		for(long i = 0; i < n; i ++) ar[(int) i] = in.nextLong();
		long j = n-1;
		long i = 0;
		long temp = 0;
		while(j >= 1) {
			if(ar[(int)j] == j+1) j--;
			else if(ar[(int)j] == 1) {
				temp = j+1;
				break;
			}
			else {
				temp = j+1;
				break;
			}
		}
		boolean flag = false;
		if(ar[(int)i] != j+1) System.out.println("no");
		else {
			long val = 1;
			for(long k = j; k >=0; k--) {
				if(ar[(int)k] != val) {
					System.out.println("no");
					flag = true;
					break;
				}
				val++;
			}
		}
		if (!flag) {
			System.out.println("yes");
			if (j == 0)System.out.println(1 + " " + 1);
			else
			System.out.println(1 + " " + temp);
		}
		in.close();
	}

}


//package c;

import java.util.Scanner;

public class Practice {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int[] arr = new int[n];
		for(int i = 0; i < n; i++) arr[i] = in.nextInt();
		int left = -1;
		for(int i = 0; i< n-1; i++) {
			if(arr[i] > arr[i+1]) {
				left = i;
				break;
			}
		}
		if(left == -1)  {
			System.out.println("yes");
			System.out.println(1 + " " + 1);
		}
		else {
			int right = n-1;
			for(int i = n-1; i >= left; i--) {
				if(arr[i] < arr[left]) {
					right = i;
					break;
				}
			}
			if((left > 0 && arr[right] < arr[left-1]) || ( right < n-1 && arr[left] > arr[right+1])) System.out.println("no");
			// checking inside segment
			else {
				boolean isValid = true;
				for(int j = left; j < right; j ++) {
					if(arr[j] < arr[j+1]) {
						isValid = false;
						break;
					}
				}
				if(isValid) {
					System.out.println("yes");
					System.out.println((left+1) + " " + (right+1));
				} else {
					System.out.println("no");
				}
			}

		}

		in.close();
	}

}


//package c;

//import java.util.Arrays;
import java.util.Scanner;

public class Solution {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner in = new Scanner(System.in);
		long n = in.nextLong();
		long[] ar = new long[(int)n];
		for(long i = 0; i < n; i ++) ar[(int) i] = in.nextLong();

		if(n > 2) {

			long l = 0;
			long r = n-1;
			while(l< r && ar[(int)l] < ar[(int) l+1] ) l++;
			while( r > l && ar[(int)r] > ar[(int) r-1] ) r--;

			long run = l;
			long run1 = r;
			while(run < run1) {
//				if(ar[(int) run] > ar[(int) run1]) {
//					long temp = ar[(int) run];
//					ar[(int) run] = ar[(int) run1];
//					ar[(int) run1] = temp;
//
//				}
				long temp = ar[(int) run];
				ar[(int) run] = ar[(int) run1];
				ar[(int) run1] = temp;
				run++;
				run1--;
			}
			boolean isSorted = true;
			for(long i = 0; i < n-1; i ++) {
				if(ar[(int) i] > ar[(int) i+1]) isSorted = false;
			}
			if(isSorted) {
				System.out.println("yes");
				System.out.println((l+1) + " " + (r+1));
			} else System.out.println("no");
		} else if (n == 2) {
			System.out.println("yes");
			if(ar[0] < ar[1])
			System.out.println(1 + " " + 1);
			else System.out.println(1 + " " + 2);
		} else if(n == 1) {
			System.out.println("yes");
			System.out.println(1 + " " + 1);
		}

		in.close();
	}

}


//package c;

import java.util.Scanner;

public class Practice {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int[] arr = new int[n];
		for(int i = 0; i < n; i++) arr[i] = in.nextInt();
		int left = -1;
		for(int i = 0; i< n-1; i++) {
			if(arr[i] > arr[i+1]) {
				left = i;
				break;
			}
		}
		if(left == -1)  {
			System.out.println("yes");
			System.out.println(1 + " " + 1);
		}
		else {
			int right = n-1;
			for(int i = n-1; i >= left; i--) {
				if(arr[i] < arr[i-1]) {
					right = i;
					break;
				}
			}
			boolean checkBound = (left > 0 && arr[left-1] != arr[right] - 1) || (right < n-1 && arr[right+1] != arr[left] + 1);
			if(checkBound) System.out.println("no");
			else {
				boolean isSorted = true;
				for(int i = left; i < right; i ++) {
					if(arr[i] < arr[i+1]) {
						isSorted = false;
						break;
					}
				} // check valid  small segment
				if(!isSorted) System.out.println("no");
				else {
					System.out.println("yes");
					System.out.println((left+1) + " " + (right+1));
				}
			}

		}

		in.close();
	}

}


//package c;

//import java.util.Arrays;
import java.util.Scanner;

public class Solution {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner in = new Scanner(System.in);
		long n = in.nextLong();
		long[] ar = new long[(int)n];
		for(long i = 0; i < n; i ++) ar[(int) i] = in.nextLong();

		if(n > 2) {

			long l = 0;
			long r = n-1;
			while(l< r && ar[(int)l] < ar[(int) l+1] ) l++;
			while( r > l && ar[(int)r] > ar[(int) r-1] ) r--;

			long run = l;
			long run1 = r;
			while(run < run1) {
				if(ar[(int) run] > ar[(int) run1]) {
					long temp = ar[(int) run];
					ar[(int) run] = ar[(int) run1];
					ar[(int) run1] = temp;

				}
				run++;
				run1--;
			}
			boolean isSorted = true;
			for(long i = 0; i < n-1; i ++) {
				if(ar[(int) i] > ar[(int) i+1]) isSorted = false;
			}
			if(isSorted) {
				System.out.println("yes");
				System.out.println((l+1) + " " + (r+1));
			} else System.out.println("no");
		} else {
			System.out.println("yes");
			if(ar[0] < ar[1])
			System.out.println(1 + " " + 1);
			else System.out.println(1 + " " + 2);
		}

		in.close();
	}

}


//package c;

import java.util.Scanner;

public class Practice {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int[] arr = new int[n];
		for(int i = 0; i < n; i++) arr[i] = in.nextInt();
		int left = -1;
		for(int i = 0; i< n-1; i++) {
			if(arr[i] > arr[i+1]) {
				left = i;
				break;
			}
		}
		if(left == -1)  {
			System.out.println("yes");
			System.out.println(1 + " " + 1);
		}
		else {
			int right = n-1;
			for(int i = n-1; i >= left; i--) {
				if(arr[i] < arr[i-1]) {
					right = i;
					break;
				}
			}
			boolean checkBound = (left > 0 && arr[left-1] > arr[right]) || (right < n-1 && arr[right+1] < arr[left]);
			if(checkBound) System.out.println("no");
			else {
				boolean isSorted = true;
				for(int i = left; i < right; i ++) {
					if(arr[i] < arr[i+1]) {
						isSorted = false;
						break;
					}
				} // check valid  small segment
				if(!isSorted) System.out.println("no");
				else {
					System.out.println("yes");
					System.out.println((left+1) + " " + (right+1));
				}
			}

		}

		in.close();
	}

}


//package c;

//import java.util.Arrays;
import java.util.Scanner;

public class Solution {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner in = new Scanner(System.in);
		long n = in.nextLong();
		long[] ar = new long[(int)n];
		for(long i = 0; i < n; i ++) ar[(int) i] = in.nextLong();

		if(n > 2) {

			long l = 0;
			long r = n-1;
			while(ar[(int)l] < ar[(int) l+1] && l< r) l++;
			while(ar[(int)r] > ar[(int) r-1] && r > l) r--;

			long run = l;
			long run1 = r;
			while(run < run1) {
				if(ar[(int) run] > ar[(int) run1]) {
					long temp = ar[(int) run];
					ar[(int) run] = ar[(int) run1];
					ar[(int) run1] = temp;

				}
				run++;
				run1--;
			}
			boolean isSorted = true;
			for(long i = 0; i < n-1; i ++) {
				if(ar[(int) i] > ar[(int) i+1]) isSorted = false;
			}
			if(isSorted) {
				System.out.println("yes");
				System.out.println((l+1) + " " + (r+1));
			} else System.out.println("no");
		} else {
			System.out.println("yes");
			if(ar[0] < ar[1])
			System.out.println(1 + " " + 1);
			else System.out.println(1 + " " + 2);
		}

		in.close();
	}

}


//package c;

//import java.util.Arrays;
import java.util.Scanner;

public class Solution {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner in = new Scanner(System.in);
		long n = in.nextLong();
		long[] ar = new long[(int)n];
		for(long i = 0; i < n; i ++) ar[(int) i] = in.nextLong();

		if(n > 2) {

			long l = 0;
			long r = n-1;
			while(l< r && ar[(int)l] < ar[(int) l+1] ) l++;
			while( r > l && ar[(int)r] > ar[(int) r-1] ) r--;

			long run = l;
			long run1 = r;
			while(run < run1) {
				if(ar[(int) run] > ar[(int) run1]) {
					long temp = ar[(int) run];
					ar[(int) run] = ar[(int) run1];
					ar[(int) run1] = temp;

				}
				run++;
				run1--;
			}
			boolean isSorted = true;
			for(long i = 0; i < n-1; i ++) {
				if(ar[(int) i] > ar[(int) i+1]) isSorted = false;
			}
			if(isSorted) {
				System.out.println("yes");
				System.out.println((l+1) + " " + (r+1));
			} else System.out.println("no");
		} else if (n == 2) {
			System.out.println("yes");
			if(ar[0] < ar[1])
			System.out.println(1 + " " + 1);
			else System.out.println(1 + " " + 2);
		} else if(n == 1) {
			System.out.println("yes");
			System.out.println(1 + " " + 1);
		}

		in.close();
	}

}


//package c;

import java.util.Scanner;

public class Practice {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int[] arr = new int[n];
		for(int i = 0; i < n; i++) arr[i] = in.nextInt();
		int left = -1;
		for(int i = 0; i< n-1; i++) {
			if(arr[i] > arr[i+1]) {
				left = i;
				break;
			}
		}
		if(left == -1)  {
			System.out.println("yes");
			System.out.println(1 + " " + 1);
		}
		else {
			int right = n-1;
			for(int i = n-1; i >= left; i--) {
				if(arr[i] < arr[left]) {
					right = i;
					break;
				}
			}
			boolean isValid = true;
			for(int j = left; j < right; j ++) {
				if(arr[j] < arr[j+1]) {
					isValid = false;
					break;
				}
			}
			if(isValid) {
				System.out.println("yes");
				System.out.println((left+1) + " " + (right+1));
			} else {
				System.out.println("no");
			}
		}

		in.close();
	}

}


import java.util.Scanner;

/**
 * Created by Baka on 21.10.2016.
 */
public class SortingAnArray {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int[] a = new int[n + 1];
//
        for (int i = 1; i < a.length; i++) {
            a[i] = scanner.nextInt();
        }

        if (a.length == 2){
            System.out.println("yes\n" + a[1] + " " + a[1]);
            return;
        }

        int i = 2;

        if (a[i] < a[i-1]){
            check(1, i, n, a);
        } else {
            i++;
            while (i<= n){
                if (a[i] >= a[i-1]){
                    i ++;
                } else {
                    break;
                }
            }
            i--;

            check(i, i, n, a);
        }
    }

    public static void check(int s, int i , int n, int[] a){
        i++;
        while (i<= n){
            if (a[i] < a[i-1])
                i++;
            else break;
        }

        i--;

        if (i == n){
            System.out.println("yes\n" + s + " " + n);
        } else if (a[s] > a[i+1]){
            System.out.println("no");
        } else {
            System.out.println("yes\n" + s + " " + i);
        }

    }
}


import java.util.Scanner;

/**
 * Created by Baka on 21.10.2016.
 */
public class SortingAnArray {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int[] a = new int[n + 1];
//
        for (int i = 1; i < a.length; i++) {
            a[i] = scanner.nextInt();
        }

        if (a.length == 2) {
            System.out.println("yes\n" + a[1] + " " + a[1]);
            return;
        }

        int i = 2;

        if (a[i] < a[i - 1]) {
            i++;
            while (i <= n) {
                if (a[i] < a[i - 1])
                    i++;
                else break;
            }

            i--;

            if (i == n) {
                System.out.println("yes\n" + 1 + " " + n);
            } else if (a[1] > a[i + 1]) {
                System.out.println("no");
            } else {
                System.out.println("yes\n" + 1 + " " + i);
            }
        } else {
            i++;
            while (i <= n) {
                if (a[i] >= a[i - 1]) {
                    i++;
                } else {
                    break;
                }
            }
            i--;

            int s = i;

            i++;
            while (i <= n) {
                if (a[i] < a[i - 1])
                    i++;
                else break;
            }

            i--;

            if (i == n && a[1] <= a[i]) {
                System.out.println("yes\n" + s + " " + n);
            } else {
                System.out.println("no");
            }
        }
    }
}