import java.util.Scanner;

public class Main {
	public static void main (String[] args) {
		Scanner scanner = new Scanner (System.in);

		try {
			int size = scanner.nextInt ();

			int[] array = new int [size];
			int max = 0;
			int start = -1;
			int end = -1;
			int left = 0;
			int right = 1;
			boolean increase = false;

			for (int index = 0; index < array.length; index++) { // O (N)
				array[index] = scanner.nextInt ();
			}

			if (size <= 2) {
				System.out.println ("yes");
				if (size == 1 || (array[0] < array[1] && size == 2))
					System.out.println ("1 1");
				else
					System.out.println ("1 2");
				return;
			}

			while (right < size) {
				if (array[left] > array[right]) {
					if (start == -1)
						start = left + 1;

					if (!increase) {
						if (end != -1) {
							System.out.println ("no");
							return;
						}
						increase = true;
					}
				} else {
					if (increase) {
						end = right;
						max = array[left - 1];
						increase = false;
					} else {
						if (max != 0 && max > array[left]) {
							System.out.println ("no");
							return;

						}
					}
				}

				left++;
				right++;
			}

			System.out.println ("yes");
			System.out.println ((start == -1 ? 1 : start) + " " + (end == -1 ? size : end));

			return;
		} catch (Exception ex) {
			ex.printStackTrace ();
		} finally {
			scanner.close ();
		}
	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;

	public class One1 {
		public static void main(String[] args)throws IOException
		{
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			int n = Integer.parseInt(br.readLine());
			StringTokenizer st = new StringTokenizer(br.readLine());
			long[] a = new long[n];
			for(int i = 0;i<n;i++)
			{
				a[i] = Long.parseLong(st.nextToken());
			}
			int s=1;
			int e=1;
			boolean can = true;
			for(int i =0;i+1<n && can;i++)
			{
				if(a[i] > a[i+1])
				{
					if(s!= 1 || e!=1)
					{
						can = false;
						break;
					}
					s = i+1;
					e= i+2;
					int k;
					for(k = i+1;k+1<n;k++)
					{
						if((a[k] < a[k+1])||(k==n-2))
						{
							if((a[i] > a[k+1]))
								can = false;
							if((i!=0)&&(a[k] < a[i-1]))
							{
								can = false;
							}
							break;
						}
						e = k+2;
					}
					i = k;
				}
			}
			Arrays.sort(a);
			for(int i = 0;i+1<n;i++)
			{
				if(a[i] == a[i+1])
				{
					can = false;
					break;
				}
			}
			if(can)
			{
				System.out.println("yes");
				System.out.println(s + " " + e);

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


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

	public class One1 {
		public static void main(String[] args)throws IOException
		{
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			int n = Integer.parseInt(br.readLine());
			StringTokenizer st = new StringTokenizer(br.readLine());
			long[] a = new long[n];
			for(int i = 0;i<n;i++)
			{
				a[i] = Long.parseLong(st.nextToken());
			}
			int s=1;
			int e=1;
			boolean can = true;
			for(int i =0;i+1<n && can;i++)
			{
				if(a[i] > a[i+1])
				{
					if(s!= 1 || e!=1)
					{
						can = false;
						break;
					}
					s = i+1;
					e= i+2;
					int k;
					for(k = i+1;k+1<n;k++)
					{
						if(a[k] <a[k+1])
						{
							if((a[i] >a[k+1]))
								can = false;
							if((i!=0)&&(a[k+1] < a[i-1]))
							{
								can = false;
							}
							break;
						}
						e = k+2;
					}
					i = k;
				}
			}
			if(can)
			{
				System.out.println("yes");
				System.out.println(s + " " + e);

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


	import java.io.BufferedReader;
	import java.io.IOException;
	import java.io.InputStreamReader;
	import java.util.Arrays;
	import java.util.StringTokenizer;

		public class One1 {
			public static void main(String[] args)throws IOException
			{
				BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
				int n = Integer.parseInt(br.readLine());
				StringTokenizer st = new StringTokenizer(br.readLine());
				long[] a = new long[n];
				for(int i = 0;i<n;i++)
				{
					a[i] = Long.parseLong(st.nextToken());
				}
				int s=1;
				int e=1;
				boolean can = true;
				for(int i =0;i+1<n && can;i++)
				{
					if(a[i] > a[i+1])
					{
						if(s!= 1 || e!=1)
						{
							can = false;
							break;
						}
						s = i+1;
						e= i+2;
						int k;
						for(k = i+1;k+1<n;k++)
						{
							if((a[k] < a[k+1])||(k==n-2))
							{
								if((k!=n-2)&&(a[i] > a[k+1]))
									can = false;
								if((i!=0)&&(a[k] < a[i-1]))
								{
									can = false;
								}
								if(k==n-2)
								e = k+2;
								break;
							}
							e = k+2;
						}
						i = k;
					}
				}
				Arrays.sort(a);
				for(int i = 0;i+1<n;i++)
				{
					if(a[i] == a[i+1])
					{
						can = false;
						break;
					}
				}
				if(can)
				{
					System.out.println("yes");
					System.out.println(s + " " + e);

				}


	import java.io.BufferedReader;
	import java.io.IOException;
	import java.io.InputStreamReader;
	import java.util.Arrays;
	import java.util.StringTokenizer;

		public class One1 {
			public static void main(String[] args)throws IOException
			{
				BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
				int n = Integer.parseInt(br.readLine());
				StringTokenizer st = new StringTokenizer(br.readLine());
				long[] a = new long[n];
				for(int i = 0;i<n;i++)
				{
					a[i] = Long.parseLong(st.nextToken());
				}
				int s=1;
				int e=1;
				boolean can = true;
				for(int i =0;i+1<n && can;i++)
				{
					if(a[i] > a[i+1])
					{
						if(s!= 1 || e!=1)
						{
							can = false;
							break;
						}
						s = i+1;
						e= i+2;
						int k;
						for(k = i+1;k+1<n;k++)
						{
							if((a[k] < a[k+1])||(k==n-2))
							{
								if((k!=n-2)&&(a[i] > a[k+1]))
									can = false;
								if((i!=0)&&(a[k] < a[i-1]))
								{
									can = false;
								}
								if((k==n-2)&&(a[k] > a[k+1]))
									e = k+2;
								break;
							}
							e = k+2;
						}
						i = k;
					}
				}
				Arrays.sort(a);
				for(int i = 0;i+1<n;i++)
				{
					if(a[i] == a[i+1])
					{
						can = false;
						break;
					}
				}
				if(can)
				{
					System.out.println("yes");
					System.out.println(s + " " + e);

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


	import java.io.BufferedReader;
	import java.io.IOException;
	import java.io.InputStreamReader;
	import java.util.Arrays;
	import java.util.StringTokenizer;

		public class One1 {
			public static void main(String[] args)throws IOException
			{
				BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
				int n = Integer.parseInt(br.readLine());
				StringTokenizer st = new StringTokenizer(br.readLine());
				long[] a = new long[n];
				for(int i = 0;i<n;i++)
				{
					a[i] = Long.parseLong(st.nextToken());
				}
				int s=1;
				int e=1;
				boolean can = true;
				for(int i =0;i+1<n && can;i++)
				{
					if(a[i] > a[i+1])
					{
						if(s!= 1 || e!=1)
						{
							can = false;
							break;
						}
						s = i+1;
						e= i+2;
						int k;
						for(k = i+1;k+1<n;k++)
						{
							if((a[k] < a[k+1])||(k==n-2))
							{
								if((k!=n-2)&&(a[i] > a[k+1]))
									can = false;
								if((i!=0)&&(a[k] < a[i-1]))
								{
									can = false;
								}
								e = k+2;
								break;
							}
							e = k+2;
						}
						i = k;
					}
				}
				Arrays.sort(a);
				for(int i = 0;i+1<n;i++)
				{
					if(a[i] == a[i+1])
					{
						can = false;
						break;
					}
				}
				if(can)
				{
					System.out.println("yes");
					System.out.println(s + " " + e);

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


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;

	public class One1 {
		public static void main(String[] args)throws IOException
		{
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			int n = Integer.parseInt(br.readLine());
			StringTokenizer st = new StringTokenizer(br.readLine());
			long[] a = new long[n];
			for(int i = 0;i<n;i++)
			{
				a[i] = Long.parseLong(st.nextToken());
			}
			int s=1;
			int e=1;
			boolean can = true;
			for(int i =0;i+1<n && can;i++)
			{
				if(a[i] > a[i+1])
				{
					if(s!= 1 || e!=1)
					{
						can = false;
						break;
					}
					s = i+1;
					e= i+2;
					int k;
					for(k = i+1;k+1<n;k++)
					{
						if(a[k] < a[k+1])
						{
							if((a[i] > a[k+1]))
								can = false;
							if((i!=0)&&(a[k] < a[i-1]))
							{
								can = false;
							}
							break;
						}
						e = k+2;
					}
					i = k;
				}
			}
			Arrays.sort(a);
			for(int i = 0;i+1<n;i++)
			{
				if(a[i] == a[i+1])
				{
					can = false;
					break;
				}
			}
			if(can)
			{
				System.out.println("yes");
				System.out.println(s + " " + e);

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


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;

	public class One1 {
		public static void main(String[] args)throws IOException
		{
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			int n = Integer.parseInt(br.readLine());
			StringTokenizer st = new StringTokenizer(br.readLine());
			long[] a = new long[n];
			for(int i = 0;i<n;i++)
			{
				a[i] = Long.parseLong(st.nextToken());
			}
			int s=1;
			int e=1;
			boolean can = true;
			for(int i =0;i+1<n && can;i++)
			{
				if(a[i] > a[i+1])
				{
					if(s!= 1 || e!=1)
					{
						can = false;
						break;
					}
					s = i+1;
					e= i+2;
					int k;
					for(k = i+1;k+1<n;k++)
					{
						if(k==n-2)
						{
							if((a[i] >a[k+1]))
								can = false;
							if((i!=0)&&(a[k] < a[i-1]))
							{
								can = false;
							}
						}
						if(a[k] < a[k+1])
						{
							if((a[i] >a[k+1]))
								can = false;
							if((i!=0)&&(a[k] < a[i-1]))
							{
								can = false;
							}
							break;
						}
						e = k+2;
					}
					i = k;
				}
			}
			Arrays.sort(a);
			for(int i = 0;i+1<n;i++)
			{
				if(a[i] == a[i+1])
				{
					can = false;
					break;
				}
			}
			if(can)
			{
				System.out.println("yes");
				System.out.println(s + " " + e);

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


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;

	public class One1 {
		public static void main(String[] args)throws IOException
		{
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			int n = Integer.parseInt(br.readLine());
			StringTokenizer st = new StringTokenizer(br.readLine());
			long[] a = new long[n];
			for(int i = 0;i<n;i++)
			{
				a[i] = Long.parseLong(st.nextToken());
			}
			int s=1;
			int e=1;
			boolean can = true;
			for(int i =0;i+1<n && can;i++)
			{
				if(a[i] > a[i+1])
				{
					if(s!= 1 || e!=1)
					{
						can = false;
						break;
					}
					s = i+1;
					e= i+2;
					int k;
					for(k = i+1;k+1<n;k++)
					{
						if(k==n-2)
						{
							//if((a[i] >a[k+1]))
								//can = false;
							if((i!=0)&&(a[k] < a[i-1]))
							{
								can = false;
							}
						}
						if(a[k] < a[k+1])
						{
							if((a[i] >a[k+1]))
								can = false;
							if((i!=0)&&(a[k] < a[i-1]))
							{
								can = false;
							}
							break;
						}
						e = k+2;
					}
					i = k;
				}
			}
			Arrays.sort(a);
			for(int i = 0;i+1<n;i++)
			{
				if(a[i] == a[i+1])
				{
					can = false;
					break;
				}
			}
			if(can)
			{
				System.out.println("yes");
				System.out.println(s + " " + e);

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


	import java.io.BufferedReader;
	import java.io.IOException;
	import java.io.InputStreamReader;
	import java.util.Arrays;
	import java.util.StringTokenizer;

		public class One1 {
			public static void main(String[] args)throws IOException
			{
				BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
				int n = Integer.parseInt(br.readLine());
				StringTokenizer st = new StringTokenizer(br.readLine());
				long[] a = new long[n];
				for(int i = 0;i<n;i++)
				{
					a[i] = Long.parseLong(st.nextToken());
				}
				int s=1;
				int e=1;
				boolean can = true;
				for(int i =0;i+1<n && can;i++)
				{
					if(a[i] > a[i+1])
					{
						if(s!= 1 || e!=1)
						{
							can = false;
							break;
						}
						s = i+1;
						e= i+2;
						int k;
						for(k = i+1;k+1<n;k++)
						{
							if((a[k] < a[k+1])||(k==n-2))
							{
								if((k!=n-2)&&(a[i] > a[k+1]))
									can = false;
								if((i!=0)&&(a[k] < a[i-1]))
								{
									can = false;
								}
								if(k==n-2)
								e = k+2;
								break;
							}
							e = k+2;
						}
						i = k;
					}
				}
				Arrays.sort(a);
				for(int i = 0;i+1<n;i++)
				{
					if(a[i] == a[i+1])
					{
						can = false;
						break;
					}
				}
				if(can)
				{
					System.out.println("yes");
					System.out.println(s + " " + e);

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


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

	public class One1 {
		public static void main(String[] args)throws IOException
		{
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			int n = Integer.parseInt(br.readLine());
			StringTokenizer st = new StringTokenizer(br.readLine());
			long[] a = new long[n];
			for(int i = 0;i<n;i++)
			{
				a[i] = Long.parseLong(st.nextToken());
			}
			int s=1;
			int e=1;
			boolean can = true;
			for(int i =0;i+1<n && can;i++)
			{
				if(a[i] >= a[i+1])
				{
					if(s!= 1 || e!=1)
					{
						can = false;
						break;
					}
					s = i+1;
					e= i+2;
					int k;
					for(k = i+1;k+1<n;k++)
					{
						if(a[k] <= a[k+1])
						{
							if((a[i] >=a[k+1]))
								can = false;
							if((i!=0)&&(a[k] < a[i-1]))
							{
								can = false;
							}
							break;
						}
						e = k+2;
					}
					i = k;
				}
			}
			if(can)
			{
				System.out.println("yes");
				System.out.println(s + " " + e);

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


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

	public class One1 {
		public static void main(String[] args)throws IOException
		{
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			int n = Integer.parseInt(br.readLine());
			StringTokenizer st = new StringTokenizer(br.readLine());
			long[] a = new long[n];
			for(int i = 0;i<n;i++)
			{
				a[i] = Long.parseLong(st.nextToken());
			}
			int s=1;
			int e=1;
			boolean can = true;
			for(int i =0;i+1<n && can;i++)
			{
				if(a[i] > a[i+1])
				{
					if(s!= 1 || e!=1)
					{
						can = false;
						break;
					}
					s = i+1;
					e= i+2;
					int k;
					for(k = i+1;k+1<n;k++)
					{
						if(a[k] <a[k+1])
						{
							if((a[i] >a[k+1]))
								can = false;
							if((i!=0)&&(a[k] < a[i-1]))
							{
								can = false;
							}
							break;
						}
						e = k+2;
					}
					i = k;
				}
			}
			if(can)
			{
				System.out.println("yes");
				System.out.println(s + " " + e);

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


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;

	public class One1 {
		public static void main(String[] args)throws IOException
		{
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			int n = Integer.parseInt(br.readLine());
			StringTokenizer st = new StringTokenizer(br.readLine());
			long[] a = new long[n];
			for(int i = 0;i<n;i++)
			{
				a[i] = Long.parseLong(st.nextToken());
			}
			int s=1;
			int e=1;
			boolean can = true;
			for(int i =0;i+1<n && can;i++)
			{
				if(a[i] > a[i+1])
				{
					if(s!= 1 || e!=1)
					{
						can = false;
						break;
					}
					s = i+1;
					e= i+2;
					int k;
					for(k = i+1;k+1<n;k++)
					{
						if(a[k] < a[k+1])
						{
							if((a[i] > a[k+1]))
								can = false;
							if((i!=0)&&(a[k] < a[i-1]))
							{
								can = false;
							}
							break;
						}
						e = k+2;
					}
					i = k;
				}
			}
			Arrays.sort(a);
			for(int i = 0;i+1<n;i++)
			{
				if(a[i] == a[i+1])
				{
					can = false;
					break;

				}
			}
			if(can)
			{
				System.out.println("yes");
				System.out.println(s + " " + e);

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


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;

	public class One1 {
		public static void main(String[] args)throws IOException
		{
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			int n = Integer.parseInt(br.readLine());
			StringTokenizer st = new StringTokenizer(br.readLine());
			long[] a = new long[n];
			for(int i = 0;i<n;i++)
			{
				a[i] = Long.parseLong(st.nextToken());
			}
			int s=1;
			int e=1;
			boolean can = true;
			for(int i =0;i+1<n && can;i++)
			{
				if(a[i] >= a[i+1])
				{
					if(s!= 1 || e!=1)
					{
						can = false;
						break;
					}
					s = i+1;
					e= i+2;
					int k;
					for(k = i+1;k+1<n;k++)
					{
						if(a[k] <= a[k+1])
						{
							if((a[i] >=a[k+1]))
								can = false;
							if((i!=0)&&(a[k] < a[i-1]))
							{
								can = false;
							}
							break;
						}
						e = k+2;
					}
					i = k;
				}
			}
			Arrays.sort(a);
			for(int i = 0;i+1<n;i++)
			{
				if(a[i] == a[i+1])
				{
					can = false;
					break;
				}
			}
			if(can)
			{
				System.out.println("yes");
				System.out.println(s + " " + e);

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


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

	public class One1 {
		public static void main(String[] args)throws IOException
		{
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			int n = Integer.parseInt(br.readLine());
			StringTokenizer st = new StringTokenizer(br.readLine());
			int[] a = new int[n];
			for(int i = 0;i<n;i++)
			{
				a[i] = Integer.parseInt(st.nextToken());
			}
			int s=1;
			int e=1;
			boolean can = true;
			for(int i =0;i+1<n && can;i++)
			{
				if(a[i] > a[i+1])
				{
					if(s!= 1 || e!=1)
					{
						can = false;
						break;
					}
					s = i+1;
					e= i+2;
					int k;
					for(k = i+1;k+1<n;k++)
					{
						if(a[k] <a[k+1])
						{
							if((a[i] >a[k+1]))
								can = false;
							if((i!=0)&&(a[k+1] < a[i-1]))
							{
								can = false;
							}
							break;
						}
						e = k+2;
					}
					i = k;
				}
			}
			if(can)
			{
				System.out.println("yes");
				System.out.println(s + " " + e);

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


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;

	public class One1 {
		public static void main(String[] args)throws IOException
		{
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			int n = Integer.parseInt(br.readLine());
			StringTokenizer st = new StringTokenizer(br.readLine());
			long[] a = new long[n];
			for(int i = 0;i<n;i++)
			{
				a[i] = Long.parseLong(st.nextToken());
			}
			int s=1;

			int e=1;
			boolean can = true;
			for(int i =0;i+1<n && can;i++)
			{
				if(a[i] > a[i+1])
				{
					if(s!= 1 || e!=1)
					{
						can = false;
						break;
					}
					s = i+1;
					e= i+2;
					int k;
					for(k = i+1;k+1<n;k++)
					{
						if(a[k] < a[k+1])
						{
							if((a[i] > a[k+1]))
								can = false;
							if((i!=0)&&(a[k] < a[i-1]))
							{
								can = false;
							}
							break;
						}
						e = k+2;
					}
					i = k;
				}
			}
			Arrays.sort(a);
			for(int i = 0;i+1<n;i++)
			{
				if(a[i] == a[i+1])
				{
					can = false;
					break;
				}
			}
			if(can)
			{
				System.out.println("yes");
				System.out.println(s + " " + e);

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


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;

	public class One1 {
		public static void main(String[] args)throws IOException
		{
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			int n = Integer.parseInt(br.readLine());
			StringTokenizer st = new StringTokenizer(br.readLine());
			long[] a = new long[n];
			for(int i = 0;i<n;i++)
			{
				a[i] = Long.parseLong(st.nextToken());
			}
			int s=1;
			int e=1;
			boolean can = true;
			for(int i =0;i+1<n && can;i++)
			{
				if(a[i] > a[i+1])
				{
					if(s!= 1 || e!=1)
					{
						can = false;
						break;
					}
					s = i+1;
					e= i+2;
					int k;
					for(k = i+1;k+1<n;k++)
					{
						if(k==n-2)
						{
							//if((a[i] >a[k+1]))
								//can = false;
							if((i!=0)&&(a[k+1] < a[i-1]))
							{
								can = false;
							}
						}
						if(a[k] < a[k+1])
						{
							if((a[i] >a[k+1]))
								can = false;
							if((i!=0)&&(a[k] < a[i-1]))
							{
								can = false;
							}
							break;
						}
						e = k+2;
					}
					i = k;
				}
			}
			Arrays.sort(a);
			for(int i = 0;i+1<n;i++)
			{
				if(a[i] == a[i+1])
				{
					can = false;
					break;
				}
			}
			if(can)
			{
				System.out.println("yes");
				System.out.println(s + " " + e);

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


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

public class NewClass {

    public static int inde(int[] a) {
        int inde = 0, elem = a[0];
        for (int i = 1; i < a.length; i++) {
            if (a[i] < elem) {
                elem = a[i];
                inde = i;
            }
        }
        return inde;
    }

    public static long sum(int[] a) {
        long su = 0;
        for (int i = 1; i < a.length; i++) {
            su += a[i];
        }
        return su;
    }

    public static void main(String[] args) throws IOException {
        InputReader in = new InputReader(System.in);
        OutputWriter out = new OutputWriter(System.out);
        int n = in.nextInt(),count=0;
        int a[] = new int[n],b[]= new int[n];
        for (int i = 0; i < n; i++) {
            a[i]=b[i]=in.nextInt();
        }
        Arrays.sort(b);
        for (int i = 0; i < n; i++) {
            if (a[i]!=b[i]) {
                count++;
            }
        }
        if (count==0) {
            out.print("yes"+"\n"+ 1+" "+1+"\n");
        }

        else if (count==2) {
            out.printLine("yes");
            for (int i = 0; i < n; i++) {
            if (a[i]!=b[i]) {
                out.print((i+1)+" ");
            }

        }
            out.printLine();
        }
         else if (count>2){
            if ((n%2==0 &&count==n)||(n%2==1 &&count==n-1)) {
                out.print("yes"+"\n"+ 1+" "+n+"\n");
            }
            else out.print("no"+"\n");
        }
        else out.print("no"+"\n");
        out.flush();

    }

}

class InputReader {

    private final InputStream stream;
    private final byte[] buf = new byte[8192];
    private int curChar, snumChars;

    public InputReader(InputStream stream) {
        this.stream = stream;
    }

    public int read() {
        if (snumChars == -1) {
            throw new InputMismatchException();
        }
        if (curChar >= snumChars) {
            curChar = 0;
            try {
                snumChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (snumChars <= 0) {
                return -1;
            }
        }
        return buf[curChar++];
    }

    public int nextInt() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public long nextLong() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        long res = 0;
        do {
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public int[] nextIntArray(int n) {
        int a[] = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = nextInt();
        }
        return a;
    }

    public String readString() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isSpaceChar(c));
        return res.toString();
    }

    public String nextLine() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isEndOfLine(c));
        return res.toString();
    }

    public boolean isSpaceChar(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    private boolean isEndOfLine(int c) {
        return c == '\n' || c == '\r' || c == -1;
    }

}

class OutputWriter {

    private final PrintWriter writer;

    public OutputWriter(OutputStream outputStream) {
        writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
    }

    public OutputWriter(Writer writer) {
        this.writer = new PrintWriter(writer);
    }

    public void print(Object... objects) {
        for (int i = 0; i < objects.length; i++) {
            if (i != 0) {
                writer.print(' ');
            }
            writer.print(objects[i]);
        }
    }

    public void printLine(Object... objects) {
        print(objects);
        writer.println();
    }

    public void close() {
        writer.close();
    }

    public void flush() {
        writer.flush();
    }

}


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

public class NewClass {
    static final int INF = Integer.MAX_VALUE;
 static void mergeSort(int[] a, int p, int r)
    {
        if( p < r )
        {
            int q = (p + r) / 2;
            mergeSort(a, p, q);
            mergeSort(a, q + 1, r);
            merge(a, p, q, r);
        }
    }

    static void merge(int[] a, int p, int q, int r)
    {
       int n1 = q - p + 1;
       int n2 = r - q;
       int[] L = new int[n1+1], R = new int[n2+1];

       for(int i = 0; i < n1; i++)  L[i] = a[p + i];
       for(int i = 0; i < n2; i++)  R[i] = a[q + 1 + i];
       L[n1] = R[n2] = INF;

       for(int k = p, i = 0, j = 0; k <= r; k++)
           if(L[i] <= R[j])
               a[k] = L[i++];
           else
               a[k] = R[j++];
    }

    public static boolean sieve(int n){
        int a[] = new int[n+1];
        for (int i = 2; i <= n; i++) a[i]=1;
        for (int i = 2; i <=Math.sqrt(n); i++) {
            if (a[i]==1) {
                for (int k = 2; i*k <=n; k++) {
                    a[i*k]=0;
                }
            }
        }
        return a[n]==1;
    }
    public static boolean zero(long f){
        long w=f;
        int co=0;
        while (w>0) {
            if (w%2==0) {
                co++;
                w/=2;
            }
            if (co>1) {
                return false;
            }
        }
        return true;
    }
    public static void main(String[] args) throws IOException {
        InputReader in = new InputReader(System.in);
        OutputWriter or = new OutputWriter(System.out);
            int n = in.nextInt(),co=0;
            int[] a=new int[n],b=new int[n];
            List<Integer> s= new ArrayList();
            for (int i = 0; i < n; i++)a[i]=b[i]=in.nextInt();
            Arrays.sort(b);
            for (int i = 0; i < n; i++) {
                if (a[i]!=b[i]) {
                    co++;
                    s.add(i+1);
                }
        }
            int q=0,w=0;
            if (co!=0) {
           q=s.get(0);
           w=s.get(s.size()-1);
        }

            boolean z=true;
           for (int i = q-1; i < w-1; i++) {
               if (a[i]<a[i+1]) {
                   z=false;
                   break;
               }
        }
           if (z) {
               if (co==0) {
                   or.print("yes"+"\n"+"1 1");
               }
               else{
                   or.print("yes"+"\n"+s.get(0)+" "+s.get(s.size()-1));
               }
        }
           else or.print("no");
           or.flush();
    }
}

class InputReader {

    private final InputStream stream;
    private final byte[] buf = new byte[8192];
    private int curChar, snumChars;

    public InputReader(InputStream stream) {
        this.stream = stream;
    }

    public int read() {
        if (snumChars == -1) {
            throw new InputMismatchException();
        }
        if (curChar >= snumChars) {
            curChar = 0;
            try {
                snumChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (snumChars <= 0) {
                return -1;
            }
        }
        return buf[curChar++];
    }

    public int nextInt() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public long nextLong() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        long res = 0;
        do {
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public int[] nextIntArray(int n) {
        int a[] = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = nextInt();
        }
        return a;
    }

    public String readString() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isSpaceChar(c));
        return res.toString();
    }

    public String nextLine() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isEndOfLine(c));
        return res.toString();
    }

    public boolean isSpaceChar(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    private boolean isEndOfLine(int c) {
        return c == '\n' || c == '\r' || c == -1;
    }

}

class OutputWriter {

    private final PrintWriter writer;

    public OutputWriter(OutputStream outputStream) {
        writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
    }

    public OutputWriter(Writer writer) {
        this.writer = new PrintWriter(writer);
    }

    public void print(Object... objects) {
        for (int i = 0; i < objects.length; i++) {
            if (i != 0) {
                writer.print(' ');
            }
            writer.print(objects[i]);
        }
    }

    public void printLine(Object... objects) {
        print(objects);
        writer.println();
    }

    public void close() {
        writer.close();
    }

    public void flush() {
        writer.flush();
    }

}


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

public class NewClass {

    public static int inde(int[] a) {
        int inde = 0, elem = a[0];
        for (int i = 1; i < a.length; i++) {
            if (a[i] < elem) {
                elem = a[i];
                inde = i;
            }
        }
        return inde;
    }

    public static long sum(int[] a) {
        long su = 0;
        for (int i = 1; i < a.length; i++) {
            su += a[i];
        }
        return su;
    }

    public static void main(String[] args) throws IOException {
        InputReader in = new InputReader(System.in);
        OutputWriter out = new OutputWriter(System.out);
        int n = in.nextInt(),count=0;
        int a[] = new int[n],b[]= new int[n];
        for (int i = 0; i < n; i++) {
            a[i]=b[i]=in.nextInt();
        }
        Arrays.sort(b);
        for (int i = 0; i < n; i++) {
            if (a[i]!=b[i]) {
                count++;
            }
        }
        if (count==0) {
            out.print("yes"+"\n"+ 1+" "+1+"\n");
        }

        else if (count==2) {
            out.printLine("yes");
            for (int i = 0; i < n; i++) {
            if (a[i]!=b[i]) {
                out.print((i+1)+" ");
            }

        }
            out.printLine();
        }
         else if (count>2){
            if ((n%2==0 &&count==n)||(n%2==1 &&count==n-1)) {
                out.print("yes"+"\n"+ 1+" "+n+"\n");
            }
        }
        else out.print("no"+"\n");
        out.flush();

    }

}

class InputReader {

    private final InputStream stream;
    private final byte[] buf = new byte[8192];
    private int curChar, snumChars;

    public InputReader(InputStream stream) {
        this.stream = stream;
    }

    public int read() {
        if (snumChars == -1) {
            throw new InputMismatchException();
        }
        if (curChar >= snumChars) {
            curChar = 0;
            try {
                snumChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (snumChars <= 0) {
                return -1;
            }
        }
        return buf[curChar++];
    }

    public int nextInt() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public long nextLong() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        long res = 0;
        do {
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public int[] nextIntArray(int n) {
        int a[] = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = nextInt();
        }
        return a;
    }

    public String readString() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isSpaceChar(c));
        return res.toString();
    }

    public String nextLine() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isEndOfLine(c));
        return res.toString();
    }

    public boolean isSpaceChar(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    private boolean isEndOfLine(int c) {
        return c == '\n' || c == '\r' || c == -1;
    }

}

class OutputWriter {

    private final PrintWriter writer;

    public OutputWriter(OutputStream outputStream) {
        writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
    }

    public OutputWriter(Writer writer) {
        this.writer = new PrintWriter(writer);
    }

    public void print(Object... objects) {
        for (int i = 0; i < objects.length; i++) {
            if (i != 0) {
                writer.print(' ');
            }
            writer.print(objects[i]);
        }
    }

    public void printLine(Object... objects) {
        print(objects);
        writer.println();
    }

    public void close() {
        writer.close();
    }

    public void flush() {
        writer.flush();
    }

}


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

public class NewClass {

    public static int inde(int[] a) {
        int inde = 0, elem = a[0];
        for (int i = 1; i < a.length; i++) {
            if (a[i] < elem) {
                elem = a[i];
                inde = i;
            }
        }
        return inde;
    }

    public static long sum(int[] a) {
        long su = 0;
        for (int i = 1; i < a.length; i++) {
            su += a[i];
        }
        return su;
    }

    public static void main(String[] args) throws IOException {
        InputReader in = new InputReader(System.in);
        OutputWriter out = new OutputWriter(System.out);
        int n = in.nextInt(),count=0;
        int a[] = new int[n],b[]= new int[n];
        for (int i = 0; i < n; i++) {
            a[i]=b[i]=in.nextInt();
        }
        Arrays.sort(b);
        for (int i = 0; i < n; i++) {
            if (a[i]!=b[i]) {
                count++;
            }
        }
        if (count==0) {
            out.print("yes"+"\n"+ 1+" "+1+"\n");
        }
        else if (count==2) {
            out.printLine("yes");
            for (int i = 0; i < n; i++) {
            if (a[i]!=b[i]) {
                out.print((i+1)+" ");
            }

        }
            out.printLine();
        }
        else out.print("no"+"\n");
        out.flush();

    }

}

class InputReader {

    private final InputStream stream;
    private final byte[] buf = new byte[8192];
    private int curChar, snumChars;

    public InputReader(InputStream stream) {
        this.stream = stream;
    }

    public int read() {
        if (snumChars == -1) {
            throw new InputMismatchException();
        }
        if (curChar >= snumChars) {
            curChar = 0;
            try {
                snumChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (snumChars <= 0) {
                return -1;
            }
        }
        return buf[curChar++];
    }

    public int nextInt() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public long nextLong() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        long res = 0;
        do {
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public int[] nextIntArray(int n) {
        int a[] = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = nextInt();
        }
        return a;
    }

    public String readString() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isSpaceChar(c));
        return res.toString();
    }

    public String nextLine() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isEndOfLine(c));
        return res.toString();
    }

    public boolean isSpaceChar(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    private boolean isEndOfLine(int c) {
        return c == '\n' || c == '\r' || c == -1;
    }

}

class OutputWriter {

    private final PrintWriter writer;

    public OutputWriter(OutputStream outputStream) {
        writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
    }

    public OutputWriter(Writer writer) {
        this.writer = new PrintWriter(writer);
    }

    public void print(Object... objects) {
        for (int i = 0; i < objects.length; i++) {
            if (i != 0) {
                writer.print(' ');
            }
            writer.print(objects[i]);
        }
    }

    public void printLine(Object... objects) {
        print(objects);
        writer.println();
    }

    public void close() {
        writer.close();
    }

    public void flush() {
        writer.flush();
    }

}


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

public class NewClass {
    static final int INF = Integer.MAX_VALUE;
 static void mergeSort(int[] a, int p, int r)
    {
        if( p < r )
        {
            int q = (p + r) / 2;
            mergeSort(a, p, q);
            mergeSort(a, q + 1, r);
            merge(a, p, q, r);
        }
    }

    static void merge(int[] a, int p, int q, int r)
    {
       int n1 = q - p + 1;
       int n2 = r - q;
       int[] L = new int[n1+1], R = new int[n2+1];

       for(int i = 0; i < n1; i++)  L[i] = a[p + i];
       for(int i = 0; i < n2; i++)  R[i] = a[q + 1 + i];
       L[n1] = R[n2] = INF;

       for(int k = p, i = 0, j = 0; k <= r; k++)
           if(L[i] <= R[j])
               a[k] = L[i++];
           else
               a[k] = R[j++];
    }

    public static boolean sieve(int n){
        int a[] = new int[n+1];
        for (int i = 2; i <= n; i++) a[i]=1;
        for (int i = 2; i <=Math.sqrt(n); i++) {
            if (a[i]==1) {
                for (int k = 2; i*k <=n; k++) {
                    a[i*k]=0;
                }
            }
        }
        return a[n]==1;
    }
    public static boolean zero(long f){
        long w=f;
        int co=0;
        while (w>0) {
            if (w%2==0) {
                co++;
                w/=2;
            }
            if (co>1) {
                return false;
            }
        }
        return true;
    }
    public static void main(String[] args) throws IOException {
        InputReader in = new InputReader(System.in);
        OutputWriter or = new OutputWriter(System.out);
            int n = in.nextInt(),co=0;
            int[] a=new int[n],b=new int[n];
            List<Integer> s= new ArrayList();
            for (int i = 0; i < n; i++)a[i]=b[i]=in.nextInt();
            Arrays.sort(b);
            for (int i = 0; i < n; i++) {
                if (a[i]!=b[i]) {
                    co++;
                    s.add(i+1);
                }
        }
            if (co==n) {
            or.print("yes"+"\n"+1+" "+n);
        }

            else if (co==n-1) {
                if (n%2==1) {
                     or.print("yes"+"\n"+s.get(0)+" "+s.get(s.size()-1));
                }
                else or.print("no");

        }
            else if (co<n-1 &&co!=0) {
            or.print("yes"+"\n"+s.get(0)+" "+s.get(s.size()-1));
        }
            else if (co==0) {
            or.print("yes"+"\n"+1+" "+1);
        }
            else or.print("no");
            or.flush();
    }
}

class InputReader {

    private final InputStream stream;
    private final byte[] buf = new byte[8192];
    private int curChar, snumChars;

    public InputReader(InputStream stream) {
        this.stream = stream;
    }

    public int read() {
        if (snumChars == -1) {
            throw new InputMismatchException();
        }
        if (curChar >= snumChars) {
            curChar = 0;
            try {
                snumChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (snumChars <= 0) {
                return -1;
            }
        }
        return buf[curChar++];
    }

    public int nextInt() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public long nextLong() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        long res = 0;
        do {
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public int[] nextIntArray(int n) {
        int a[] = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = nextInt();
        }
        return a;
    }

    public String readString() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isSpaceChar(c));
        return res.toString();
    }

    public String nextLine() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isEndOfLine(c));
        return res.toString();
    }

    public boolean isSpaceChar(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    private boolean isEndOfLine(int c) {
        return c == '\n' || c == '\r' || c == -1;
    }

}

class OutputWriter {

    private final PrintWriter writer;

    public OutputWriter(OutputStream outputStream) {
        writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
    }

    public OutputWriter(Writer writer) {
        this.writer = new PrintWriter(writer);
    }

    public void print(Object... objects) {
        for (int i = 0; i < objects.length; i++) {
            if (i != 0) {
                writer.print(' ');
            }
            writer.print(objects[i]);
        }
    }

    public void printLine(Object... objects) {
        print(objects);
        writer.println();
    }

    public void close() {
        writer.close();
    }

    public void flush() {
        writer.flush();
    }

}


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

public class NewClass {

    public static int inde(int[] a) {
        int inde = 0, elem = a[0];
        for (int i = 1; i < a.length; i++) {
            if (a[i] < elem) {
                elem = a[i];
                inde = i;
            }
        }
        return inde;
    }

    public static long sum(int[] a) {
        long su = 0;
        for (int i = 1; i < a.length; i++) {
            su += a[i];
        }
        return su;
    }

    public static void main(String[] args) throws IOException {
        InputReader in = new InputReader(System.in);
        OutputWriter out = new OutputWriter(System.out);
        int n = in.nextInt(),count=0;
        int a[] = new int[n],b[]= new int[n];
        for (int i = 0; i < n; i++) {
            a[i]=b[i]=in.nextInt();
        }
        Arrays.sort(b);
        for (int i = 0; i < n; i++) {
            if (a[i]!=b[i]) {
                count++;
            }
        }
        if (count==0) {
            out.print("yes"+"\n"+ a[0]+" "+a[0]+"\n");
        }
        else if (count==2) {
            out.printLine("yes");
            for (int i = 0; i < n; i++) {
            if (a[i]!=b[i]) {
                out.print(b[i]+" ");
            }

        }
            out.printLine();
        }
        else out.print("no"+"\n");
        out.flush();

    }

}

class InputReader {

    private final InputStream stream;
    private final byte[] buf = new byte[8192];
    private int curChar, snumChars;

    public InputReader(InputStream stream) {
        this.stream = stream;
    }

    public int read() {
        if (snumChars == -1) {
            throw new InputMismatchException();
        }
        if (curChar >= snumChars) {
            curChar = 0;
            try {
                snumChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (snumChars <= 0) {
                return -1;
            }
        }
        return buf[curChar++];
    }

    public int nextInt() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public long nextLong() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        long res = 0;
        do {
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public int[] nextIntArray(int n) {
        int a[] = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = nextInt();
        }
        return a;
    }

    public String readString() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isSpaceChar(c));
        return res.toString();
    }

    public String nextLine() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isEndOfLine(c));
        return res.toString();
    }

    public boolean isSpaceChar(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    private boolean isEndOfLine(int c) {
        return c == '\n' || c == '\r' || c == -1;
    }

}

class OutputWriter {

    private final PrintWriter writer;

    public OutputWriter(OutputStream outputStream) {
        writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
    }

    public OutputWriter(Writer writer) {
        this.writer = new PrintWriter(writer);
    }

    public void print(Object... objects) {
        for (int i = 0; i < objects.length; i++) {
            if (i != 0) {
                writer.print(' ');
            }
            writer.print(objects[i]);
        }
    }

    public void printLine(Object... objects) {
        print(objects);
        writer.println();
    }

    public void close() {
        writer.close();
    }

    public void flush() {
        writer.flush();
    }

}


import java.util.Scanner;
import java.util.Arrays;
public class HelloWorld{
 public static void main(String []args){
       int n,a[];
       Scanner in = new Scanner(System.in);
       n=in.nextInt();
       a=new int[n];

       for(int i=0;i<n;i++)a[i]=in.nextInt();
       int count=0;
       int max=0,min=0,m1=0,m2=0,i1=0,i2=0;
       for(int i=1;i<n-1;i++){
           if(a[i]>a[i-1]&&a[i]>a[i+1]){
               count++;
               max=a[i];
               m1=a[i-1];
               i1=i;
           }
           if(count>0&&a[i]<a[i-1]&&a[i]<a[i+1]){
               count++;
               min=a[i];
               m2=a[i+1];
               i2=i;
           }

       }
        if(count==0){
            if(a[0]>a[1]&&a[0]<=a[2]){
                System.out.println("yes");
                System.out.print(1+" "+2);
            }
            else if(a[n-1]<a[n-2]&&a[n-1]>=a[n-3]){
                System.out.println("yes");
                System.out.println(n-1+" "+n);
            }
               else if(a[0]<=a[1]&&a[n-1]>=a[n-2]){
                   System.out.println("yes");
               System.out.print(1+" "+1);
               }
               else if(a[0]>=a[1]&&a[n-1]<=a[n-2]){
                System.out.println("yes");
               System.out.print(1+" "+n);
               }
               else count=3;
        }
        else if(count==2&&min>=m1&&max<=m2){
            System.out.println("yes");
            System.out.print(i1+1+" "+i2+1);
        }

       if(count>2)System.out.println("no");
             }
}


import java.util.Scanner;
import java.util.Arrays;
public class HelloWorld{
 public static void main(String []args){
       int n,a[];
       Scanner in = new Scanner(System.in);
       n=in.nextInt();
       a=new int[n];

       for(int i=0;i<n;i++)a[i]=in.nextInt();
       int count=0;
       int max=0,min=0,m1=0,m2=0,i1=0,i2=0;
      if(n<=2){
          System.out.println("yes");
          if(a[0]>a[1])System.out.println(1+" "+2);
          else System.out.println(1+" "+1);

      }
      else{
       for(int i=1;i<n-1;i++){
           if(a[i]>a[i-1]&&a[i]>a[i+1]){
               count++;
               max=a[i];
               m1=a[i-1];
               i1=i;
           }
           if(count>0&&a[i]<a[i-1]&&a[i]<a[i+1]){
               count++;
               min=a[i];
               m2=a[i+1];
               i2=i;
           }

       }
        if(count==0){
            if(a[0]>a[1]&&a[0]<=a[2]){
                System.out.println("yes");
                System.out.print(1+" "+2);
            }
            else if(a[n-1]<a[n-2]&&a[n-1]>=a[n-3]){
                System.out.println("yes");
                System.out.println(n-1+" "+n);
            }
               else if(a[0]<=a[1]&&a[n-1]>=a[n-2]){
                   System.out.println("yes");
               System.out.print(1+" "+1);
               }
               else if(a[0]>=a[1]&&a[n-1]<=a[n-2]){
                System.out.println("yes");
               System.out.print(1+" "+n);
               }
               else count=3;
        }
        else if(count==2&&min>=m1&&max<=m2){
            System.out.println("yes");
            System.out.print(i1+1+" "+i2+1);
        }

       if(count>2)System.out.println("no");
      }
             }
}


import java.util.Scanner;
public class HelloWorld{
 public static void main(String []args){
      int n,a[];
      Scanner in = new Scanner(System.in);
      n=in.nextInt();
      a=new int[n];
      for(int i=0;i<n;i++)a[i]=in.nextInt();
      int count=0,i1=0,i2=0,max=0,min=0,m1=0,m2=0;
      if(n<2){
          System.out.println("yes");
          System.out.println(1+" "+1);
      }
      else{
      for(int i=1;i<n-1;i++){
        if(a[i]<a[i-1]&&a[i]<a[i+1]){
            count++;
            min=a[i];
            m2=a[i+1];
            i2=i;
        }
        if(a[i]>a[i-1]&&a[i]>a[i+1]){
            count++;
            max=a[i];
            m1=a[i-1];
            i1=i;
        }
      }
      if(count==0){
    if(a[0]>a[1]){
        System.out.println("yes");
        System.out.println(1+" "+n);
    }
    else if(a[0]<a[1]){
        System.out.println("yes");
        System.out.println(1+" "+1);
    }
    else
    System.out.println("no");
          }
    if(count==1){
    if(a[0]>a[1]&&m2>a[0]){
        System.out.println("yes");
        System.out.println(1+" "+(i2+1));
    }
   else if(a[n-1]<a[n-2]&&m1<a[n-1]){
        System.out.println("yes");
        System.out.println((i1+1)+" "+n);
    }
    else
    System.out.println("no");
    }
    if(count==2){
        if(max<m2&&min>m1){
            System.out.println("yes");
            System.out.println((i1+1)+" "+(i2+1));
        }
        else
        System.out.println("no");
    }
    if(count>2)System.out.println("no");
      }
             }
}


import java.util.Scanner;
import java.util.Arrays;
public class HelloWorld{
 public static void main(String []args){
       int n,a[];
       Scanner in = new Scanner(System.in);
       n=in.nextInt();
       a=new int[n];

       for(int i=0;i<n;i++)a[i]=in.nextInt();
       int count=0;
       int max=0,min=0,m1=0,m2=0,i1=0,i2=0;
      if(n<=2){
          System.out.println("yes");
          if(a[0]>a[1])System.out.println(1+" "+2);
          else System.out.println(1+" "+1);

      }
      else{
       for(int i=1;i<n-1;i++){
           if(a[i]>a[i-1]&&a[i]>a[i+1]){
               count++;
               max=a[i];
               m1=a[i-1];
               i1=i;
           }
           if(count>0&&a[i]<a[i-1]&&a[i]<a[i+1]){
               count++;
               min=a[i];
               m2=a[i+1];
               i2=i;
           }

       }
        if(count==0){
            if(a[0]>a[1]&&a[0]<=a[2]){
                System.out.println("yes");
                System.out.print(1+" "+2);
            }
            else if(a[n-1]<a[n-2]&&a[n-1]>=a[n-3]){
                System.out.println("yes");
                System.out.println(n-1+" "+n);
            }
               else if(a[0]<=a[1]&&a[n-1]>=a[n-2]){
                   System.out.println("yes");
               System.out.print(1+" "+1);
               }
               else if(a[0]>=a[1]&&a[n-1]<=a[n-2]){
                System.out.println("yes");
               System.out.print(1+" "+n);
               }
               else count=3;
        }
        else if(count==2&&min>=m1&&max<=m2){
            System.out.println("yes");
            System.out.print((i1+1)+" "+(i2+1));
        }

       if(count>2)System.out.println("no");
      }
             }
}


import java.util.Scanner;
public class HelloWorld{
 public static void main(String []args){
      int n,a[];
      Scanner in = new Scanner(System.in);
      n=in.nextInt();
      a=new int[n];
      for(int i=0;i<n;i++)a[i]=in.nextInt();
      int count=0,i1=0,i2=0,max=0,min=0,m1=0,m2=0;
      for(int i=1;i<n-1;i++){
        if(a[i]<a[i-1]&&a[i]<a[i+1]){
            count++;
            min=a[i];
            m2=a[i+1];
            i2=i;
        }
        if(a[i]>a[i-1]&&a[i]>a[i+1]){
            count++;
            max=a[i];
            m1=a[i-1];
            i1=i;
        }
      }
      if(count==0){
    if(a[0]>a[1]){
        System.out.println("yes");
        System.out.println(1+" "+n);
    }
    if(a[0]<a[1]){
        System.out.println("yes");
        System.out.println(1+" "+1);
    }
          }
    if(count==1){
    if(a[0]>a[1]&&m2>a[0]){
        System.out.println("yes");
        System.out.println(1+" "+(i2+1));
    }
   else if(a[n-1]<a[n-2]&&m1<a[n-1]){
        System.out.println("yes");
        System.out.println((i1+1)+" "+n);
    }
    else
    System.out.println("no");
    }
    if(count==2){
        if(max<m2&&min>m1){
            System.out.println("yes");
            System.out.println((i1+1)+" "+(i2+1));
        }
    }
    if(count>2)System.out.println("no");

             }
}


import java.util.Scanner;
public class HelloWorld{
 public static void main(String []args){
      int n,a[];
      Scanner in = new Scanner(System.in);
      n=in.nextInt();
      a=new int[n];
      for(int i=0;i<n;i++)a[i]=in.nextInt();
      int count=0,i1=0,i2=0,max=0,min=0,m1=0,m2=0;
      for(int i=1;i<n-1;i++){
        if(a[i]<a[i-1]&&a[i]<a[i+1]){
            count++;
            min=a[i];
            m2=a[i+1];
            i2=i;
        }
        if(a[i]>a[i-1]&&a[i]>a[i+1]){
            count++;
            max=a[i];
            m1=a[i-1];
            i1=i;
        }
      }
      if(count==0){
    if(a[0]>a[1]){
        System.out.println("yes");
        System.out.println(1+" "+n);
    }
    else if(a[0]<a[1]){
        System.out.println("yes");
        System.out.println(1+" "+1);
    }
    else
    System.out.println("no");
          }
    if(count==1){
    if(a[0]>a[1]&&m2>a[0]){
        System.out.println("yes");
        System.out.println(1+" "+(i2+1));
    }
   else if(a[n-1]<a[n-2]&&m1<a[n-1]){
        System.out.println("yes");
        System.out.println((i1+1)+" "+n);
    }
    else
    System.out.println("no");
    }
    if(count==2){
        if(max<m2&&min>m1){
            System.out.println("yes");
            System.out.println((i1+1)+" "+(i2+1));
        }
        else
        System.out.println("no");
    }
    if(count>2)System.out.println("no");

             }
}


import java.util.Scanner;
public class HelloWorld{
 public static void main(String []args){
      int n,a[];
      Scanner in = new Scanner(System.in);
      n=in.nextInt();
      a=new int[n];
      for(int i=0;i<n;i++)a[i]=in.nextInt();
      int count=0,i1=0,i2=0,max=0,min=0,m1=0,m2=0;
      for(int i=1;i<n-1;i++){
        if(a[i]<a[i-1]&&a[i]<a[i+1]){
            count++;
            min=a[i];
            m2=a[i+1];
            i2=i;
        }
        if(a[i]>a[i-1]&&a[i]>a[i+1]){
            count++;
            max=a[i];
            m1=a[i-1];
            i1=i;
        }
      }
      if(count==0){
    if(a[0]>a[1]){
        System.out.println("yes");
        System.out.println(1+" "+n);
    }
    if(a[0]<a[1]){
        System.out.println("yes");
        System.out.println(1+" "+1);
    }
          }
    if(count==1){
    if(a[0]>a[1]&&m2>a[0]){
        System.out.println("yes");
        System.out.println(1+" "+(i2+1));
    }
   else if(a[n-1]<a[n-2]&&m1<a[n-1]){
        System.out.println("yes");
        System.out.println((i1+1)+" "+(n-1));
    }
    else
    System.out.println("no");
    }
    if(count==2){
        if(max<m2&&min>m1){
            System.out.println("yes");
            System.out.println((i1+1)+" "+(i2+1));
        }
    }
    if(count>2)System.out.println("no");

             }
}


import java.util.Scanner;
import java.util.Arrays;
public class HelloWorld{
 public static void main(String []args){
       int n,a[];
       Scanner in = new Scanner(System.in);
       n=in.nextInt();
       a=new int[n];

       for(int i=0;i<n;i++)a[i]=in.nextInt();
       int count=0;
       int max=0,min=0,m1=0,m2=0,i1=0,i2=0;
      if(n<=2){
          System.out.prinln("yes");
          if(a[0]>a[1])System.out.prinln(1+" "+2);
          else System.out.prinln(1+" "+1);

      }
      else{
       for(int i=1;i<n-1;i++){
           if(a[i]>a[i-1]&&a[i]>a[i+1]){
               count++;
               max=a[i];
               m1=a[i-1];
               i1=i;
           }
           if(count>0&&a[i]<a[i-1]&&a[i]<a[i+1]){
               count++;
               min=a[i];
               m2=a[i+1];
               i2=i;
           }

       }
        if(count==0){
            if(a[0]>a[1]&&a[0]<=a[2]){
                System.out.println("yes");
                System.out.print(1+" "+2);
            }
            else if(a[n-1]<a[n-2]&&a[n-1]>=a[n-3]){
                System.out.println("yes");
                System.out.println(n-1+" "+n);
            }
               else if(a[0]<=a[1]&&a[n-1]>=a[n-2]){
                   System.out.println("yes");
               System.out.print(1+" "+1);
               }
               else if(a[0]>=a[1]&&a[n-1]<=a[n-2]){
                System.out.println("yes");
               System.out.print(1+" "+n);
               }
               else count=3;
        }
        else if(count==2&&min>=m1&&max<=m2){
            System.out.println("yes");
            System.out.print(i1+1+" "+i2+1);
        }

       if(count>2)System.out.println("no");
      }
             }
}


import java.math.*;
import java.util.*;

public class Solving {
    public static Scanner in =new Scanner(System.in);
    public static int count(int[]a,int[]b){
        int count=0;
        for(int i=0;i<a.length;i++){
            int ai=a[i];
            int bi=b[i];
            if(ai!=bi)
                count++;
        }
            return count;
    }
    public static void solve(int[]a,int[]b){
        int ai=-1;
        int bi=-1;
        for(int i=0;i<a.length;i++){
            int curA=a[i];
            int curB=b[i];
            if(curA!=curB){
                ai=i;
                break;
            }
        }
         for(int i=ai+1;i<a.length;i++){
            int curA=a[i];
            int curB=b[i];
            if(curA!=curB){
                bi=i;
                break;
            }
        }

        System.out.println("yes");
        System.out.println((ai+1)+" "+(bi+1));
    }
    public static void main(String[] args){
        int n=in.nextInt();
        int[]a=new int[n];
        int[]b=new int[n];
        for(int i=0;i<n;i++){
            a[i]=in.nextInt();
            b[i]=a[i];
        }
       if(n==1){
           System.out.println("yes");
           System.out.println(1+" "+1);
       }
       else if(n==2){
           if(a[0]>a[1]){
               System.out.println("yes");
               System.out.println(1+" "+2);
           }
           else{
                System.out.println("yes");
               System.out.println(1+" "+1);
           }
       }
       else{
           Arrays.sort(b);
       int count=count(a,b);
       if(count==2)
           solve(a,b);
       else
            System.out.println("no");
       }
    }
}


import java.math.*;

import java.util.*;

public class BruteForce {

    public static Scanner in =new Scanner(System.in);
   /* public static String getB(int n,int l){
        StringBuilder build=new StringBuilder();
             while(n>0){
            if(n%2==0)
                build.append(0);
            else
                build.append(1);
            n/=2;
        }
             if(build.toString().length()<l){
                 int dif=Math.abs(build.toString().length()-l);
                 for(int i=1;i<=dif;i++)
                     build.append("0");
             }
        return build.reverse().toString();
    }
    public static int getN(String a){
        StringBuilder build=new StringBuilder(a);
        String z=build.reverse().toString();
        int sum=0;
        for(int i=0;i<z.length();i++){
            int c=Integer.parseInt(z.charAt(i)+"");
            int ans=(int) (c*Math.pow(2,i));
            sum+=ans;
        }
        return sum;
    }
    public static int bs(int[]z,int x){
        int ans=-1;
        int l=0;
        int r=z.length-1;
        while(l<=r&&r<z.length){

            int mid=l+(r-l)/2;

            if(z[mid]==x){
                ans=mid;
                break;
            }
            else if(z[mid]>x){
                r=mid-1;
            }
            else if(z[mid]<x){
                l=mid+1;
            }
        }
        return ans;
    }
    public static long getLCM(LinkedList<Integer> list){
        long lcm=1;
        for(int i=0;i<list.size();i++){
            lcm=Algo.lcm(lcm,list.get(i));
        }
        return lcm;
    }*/
    public static boolean check(int[]a,int[]b){
        boolean ans=true;
        for(int i=0;i<a.length;i++)
            if(a[i]!=b[i]){
                ans=false;
                break;
            }

        return ans;
    }
    public static void main(String[] args){
        int n=in.nextInt();
        int[]z=new int[n];
        int[]test=new int[n];
        for(int i=0;i<n;i++){
            z[i]=in.nextInt();
            test[i]=z[i];
        }
        Arrays.sort(test);
        int idx=-1;int j=-1;
        for(int i=0;i<n;i++){
            int curZ=z[i];
            int curT=test[i];
            if(curZ!=curT){
                idx=i;
                break;
            }
        }
        for(int i=n-1;i>=0;i--){
            int curZ=z[i];
            int curT=test[i];
            if(curZ!=curT){
                j=i;
                break;
            }
        }
        if(idx==-1&&j==-1){
            System.out.println("yes");
            System.out.println("1 1");
        }
        else{
            ArrayList<Integer>list=new ArrayList<Integer>();
            for(int i=j;i>=idx;i--)
                list.add(z[i]);
            for(int i=idx;i<=j;i++)
                z[i]=list.get(i);
            if(check(z,test)){
                System.out.println("yes");
                System.out.println((idx+1)+" "+(j+1));
            }
            else
                System.out.println("no");
        }
    }

}


import java.util.*;

public class Solving {

private static Scanner in =new Scanner(System.in);

 public static void main(String[] args){
     int n=in.nextInt();
     int[]a=new int[n];
     int[]b=new int[n];
     for(int i=0;i<n;i++){
         a[i]=in.nextInt();
         b[i]=a[i];
     }
     Arrays.sort(b);
     int count=0;
     for(int i=0;i<n;i++){
         int cur=a[i];
         int index=Arrays.binarySearch(b,cur);
         if(index!=i)
             count++;
     }
     if(count==2){
         int index1=-1;
         int index2=-1;
         int c=0;
         for(int i=0;i<n;i++){
             int xa=a[i];
             int xb=b[i];
             if(xa!=xb&&c==0){
                 index1=i;
                 c++;
             }
             else if(xa!=xb&&c==1){
                 index2=i;
             }
         }
         System.out.println("yes");
         System.out.println((index1+1)+" "+(index2+1));
     }
     else if(count==0){
         System.out.println("yes");
         System.out.println(b[0]+" "+b[0]);
     }
     else
         System.out.println("no");
 }
}


import java.math.*;

import java.util.*;

public class BruteForce {

    public static Scanner in =new Scanner(System.in);
    public static String getB(int n,int l){
        StringBuilder build=new StringBuilder();
             while(n>0){
            if(n%2==0)
                build.append(0);
            else
                build.append(1);
            n/=2;
        }
             if(build.toString().length()<l){
                 int dif=Math.abs(build.toString().length()-l);
                 for(int i=1;i<=dif;i++)
                     build.append("0");
             }
        return build.reverse().toString();
    }
    public static int getN(String a){
        StringBuilder build=new StringBuilder(a);
        String z=build.reverse().toString();
        int sum=0;
        for(int i=0;i<z.length();i++){
            int c=Integer.parseInt(z.charAt(i)+"");
            int ans=(int) (c*Math.pow(2,i));
            sum+=ans;
        }
        return sum;
    }
    public static int bs(int[]z,int x){
        int ans=-1;
        int l=0;
        int r=z.length-1;
        while(l<=r&&r<z.length){

            int mid=l+(r-l)/2;

            if(z[mid]==x){
                ans=mid;
                break;
            }
            else if(z[mid]>x){
                r=mid-1;
            }
            else if(z[mid]<x){
                l=mid+1;
            }
        }
        return ans;
    }
    public static long getLCM(LinkedList<Integer> list){
        long lcm=1;
        for(int i=0;i<list.size();i++){
            lcm=Algo.lcm(lcm,list.get(i));
        }
        return lcm;
    }
    public static boolean check(int[]a,int[]b){
        boolean ans=true;
        for(int i=0;i<a.length;i++)
            if(a[i]!=b[i]){
                ans=false;
                break;
            }

        return ans;
    }
    public static void main(String[] args){
        int n=in.nextInt();
        int[]z=new int[n];
        int[]test=new int[n];
        for(int i=0;i<n;i++){
            z[i]=in.nextInt();
            test[i]=z[i];
        }
        Arrays.sort(test);
        int idx=-1;int j=-1;
        for(int i=0;i<n;i++){
            int curZ=z[i];
            int curT=test[i];
            if(curZ!=curT){
                idx=i;
                break;
            }
        }
        for(int i=n-1;i>=0;i--){
            int curZ=z[i];
            int curT=test[i];
            if(curZ!=curT){
                j=i;
                break;
            }
        }
        if(idx==-1&&j==-1){
            System.out.println("yes");
            System.out.println("1 1");
        }
        else{
            ArrayList<Integer>list=new ArrayList<Integer>();
            for(int i=j;i>=idx;i--)
                list.add(z[i]);
            for(int i=idx;i<=j;i++)
                z[i]=list.get(i);
            if(check(z,test)){
                System.out.println("yes");
                System.out.println((idx+1)+" "+(j+1));
            }
            else
                System.out.println("no");
        }
    }

}


import java.util.*;

public class Solving {

private static Scanner in =new Scanner(System.in);

 public static void main(String[] args){
     int n=in.nextInt();
     int[]a=new int[n];
     int[]b=new int[n];
     for(int i=0;i<n;i++){
         a[i]=in.nextInt();
         b[i]=a[i];
     }
     Arrays.sort(b);
     int count=0;
     for(int i=0;i<n;i++){
         int cur=a[i];
         int index=Arrays.binarySearch(b,cur);
         if(index!=i)
             count++;
     }
     if(count==2){
         int index1=-1;
         int index2=-1;
         int c=0;
         for(int i=0;i<n;i++){
             int xa=a[i];
             int xb=b[i];
             if(xa!=xb&&c==0){
                 index1=i;
                 c++;
             }
             else if(xa!=xb&&c==1){
                 index2=i;
             }
         }
         System.out.println("yes");
         System.out.println(b[index1]+" "+b[index2]);
     }
     else if(count==0){
         System.out.println("yes");
         System.out.println(b[0]+" "+b[0]);
     }
     else
         System.out.println("no");
 }
}


import java.math.*;
import java.util.*;

public class Solving {
    public static Scanner in =new Scanner(System.in);
    public static int count(int[]a,int[]b){
        int count=0;
        for(int i=0;i<a.length;i++){
            int ai=a[i];
            int bi=b[i];
            if(ai!=bi)
                count++;
        }
            return count;
    }
    public static void solve(int[]a,int[]b){
        int ai=-1;
        int bi=-1;
        for(int i=0;i<a.length;i++){
            int curA=a[i];
            int curB=b[i];
            if(curA!=curB){
                ai=i;
                break;
            }
        }
         for(int i=ai+1;i<a.length;i++){
            int curA=a[i];
            int curB=b[i];
            if(curA!=curB){
                bi=i;
                break;
            }
        }

        System.out.println("yes");
        System.out.println(a[bi]+" "+a[ai]);
    }
    public static void main(String[] args){
        int n=in.nextInt();
        int[]a=new int[n];
        int[]b=new int[n];
        for(int i=0;i<n;i++){
            a[i]=in.nextInt();
            b[i]=a[i];
        }
       if(n==1){
           System.out.println("yes");
           System.out.println(a[0]+" "+a[0]);
       }
       else if(n==2){
           if(a[0]>a[1]){
               System.out.println("yes");
               System.out.println(a[1]+" "+a[0]);
           }
           else{
                System.out.println("yes");
               System.out.println(a[0]+" "+a[0]);
           }
       }
       else{
           Arrays.sort(b);
       int count=count(a,b);
       if(count==2)
           solve(a,b);
       else
            System.out.println("no");
       }
    }
}


import java.math.*;

import java.util.*;

public class BruteForce {

    public static Scanner in =new Scanner(System.in);
   /* public static String getB(int n,int l){
        StringBuilder build=new StringBuilder();
             while(n>0){
            if(n%2==0)
                build.append(0);
            else
                build.append(1);
            n/=2;
        }
             if(build.toString().length()<l){
                 int dif=Math.abs(build.toString().length()-l);
                 for(int i=1;i<=dif;i++)
                     build.append("0");
             }
        return build.reverse().toString();
    }
    public static int getN(String a){
        StringBuilder build=new StringBuilder(a);
        String z=build.reverse().toString();
        int sum=0;
        for(int i=0;i<z.length();i++){
            int c=Integer.parseInt(z.charAt(i)+"");
            int ans=(int) (c*Math.pow(2,i));
            sum+=ans;
        }
        return sum;
    }
    public static int bs(int[]z,int x){
        int ans=-1;
        int l=0;
        int r=z.length-1;
        while(l<=r&&r<z.length){

            int mid=l+(r-l)/2;

            if(z[mid]==x){
                ans=mid;
                break;
            }
            else if(z[mid]>x){
                r=mid-1;
            }
            else if(z[mid]<x){
                l=mid+1;
            }
        }
        return ans;
    }
    public static long getLCM(LinkedList<Integer> list){
        long lcm=1;
        for(int i=0;i<list.size();i++){
            lcm=Algo.lcm(lcm,list.get(i));
        }
        return lcm;
    }*/
    public static boolean check(int[]a,int[]b){
        boolean ans=true;
        for(int i=0;i<a.length;i++)
            if(a[i]!=b[i]){
                ans=false;
                break;
            }

        return ans;
    }
    public static void main(String[] args){
        int n=in.nextInt();
        int[]z=new int[n];
        int[]test=new int[n];
        for(int i=0;i<n;i++){
            z[i]=in.nextInt();
            test[i]=z[i];
        }
        Arrays.sort(test);
        int idx=-1;int j=-1;
        for(int i=0;i<n;i++){
            int curZ=z[i];
            int curT=test[i];
            if(curZ!=curT){
                idx=i;
                break;
            }
        }
        for(int i=n-1;i>=0;i--){
            int curZ=z[i];
            int curT=test[i];
            if(curZ!=curT){
                j=i;
                break;
            }
        }
        if(idx==-1&&j==-1){
            System.out.println("yes");
            System.out.println("1 1");
        }
        else{
           ArrayList<Integer>list=new ArrayList<Integer>();
            for(int i=j;i>=idx;i--)
                list.add(z[i]);
            int index=0;
            for(int i=idx;i<=j;i++)
                z[i]=list.get(index++);
           if(check(z,test)){
                System.out.println("yes");
                System.out.println((idx+1)+" "+(j+1));
            }
            else
                System.out.println("no");

        }
    }

}


import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Scanner;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author uuu
 */
public class SorttheArray451b {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int[]x=new int[n];
        int[]y=new int[n];
        ArrayList<Integer> z=new ArrayList<>();
        int c=0;
        for (int i = 0; i < n; i++) {
            x[i]=in.nextInt();
            y[i]=x[i];
        }
        Arrays.sort(y);

        for (int i = 0; i < n; i++) {
            if (x[i]!=y[i]) {
                c++;
            if (c>2) {
                System.out.println("no");break;
            }
            z.add(i+1);
            }

        }
        Collections.sort(z);
        if (c==2) {
            System.out.println("yes");
            System.out.println(z.get(0)+" "+z.get(1));
        }else if(c==0){System.out.println("yes"); System.out.println(x[0]+" "+x[0]);}

    }

}


import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Scanner;

public class SorttheArray451b {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int[]x=new int[n];
        int[]y=new int[n];
        ArrayList<Integer> z=new ArrayList<>();
        ArrayList<Integer> f=new ArrayList<>();
        int c=0;
        int c1=0;
        for (int i = 0; i < n; i++) {
            x[i]=in.nextInt();
            y[i]=x[i];
        }
        Arrays.sort(y);
        for (int i = 0,j=n-1; i < n; i++,j--) {
            if (x[i]!=y[j]) {
                c1++;
            if (c1>2) {
                break;
            }
            f.add(i+1);
            }

        }

      if(c1==0){
          System.out.println("yes"); System.out.println("1 "+n);
      }else{
        for (int i = 0; i < n; i++) {
            if (x[i]!=y[i]) {
                c++;
            if (c>2) {
                System.out.println("no");break;
            }
            z.add(i+1);
            }

        }
        Collections.sort(z);
        if (c==2) {
            System.out.println("yes");
            System.out.println(z.get(0)+" "+z.get(1));
        }else if(c==0){System.out.println("yes"); System.out.println("1 1");}
      }
        }
    }


import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Scanner;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author uuu
 */
public class SorttheArray451b {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int[]x=new int[n-1+1];
        int[]y=new int[n];
        ArrayList<Integer> z=new ArrayList<>();
        ArrayList<Integer> f=new ArrayList<>();
        int c=0;
        int c1=0;
        for (int i = 0; i < n; i++) {
            x[i]=in.nextInt();
            y[i]=x[i];
        }
        Arrays.sort(y);
        boolean tt = true;
        if (tt) {

        for (int i = 0,j=n-1; i < n; i++,j--) {
            if (x[i]!=y[j]) {
                c1++;
            if (c1>2) {
                tt=false;break;
            }
            f.add(i+1);
            }

        }

        if (c1==2) {
            Collections.sort(f);
            System.out.println("yes");
            System.out.println(f.get(0)+" "+f.get(1));
        }else if(c1==0){System.out.println("yes"); System.out.println("1 "+n);}

        }
        if (tt==false) {

        for (int i = 0; i < n; i++) {
            if (x[i]!=y[i]) {
                c++;
            if (c>2) {
                System.out.println("no");break;
            }
            z.add(i+1);
            }

        }
        Collections.sort(z);
        if (c==2) {
            System.out.println("yes");
            System.out.println(z.get(0)+" "+z.get(1));
        }else if(c==0){System.out.println("yes"); System.out.println("1 1");}

        }
    }

}


import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Scanner;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author uuu
 */
public class SorttheArray451b {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int[]x=new int[n-1+1];
        int[]y=new int[n];
        ArrayList<Integer> z=new ArrayList<>();
        ArrayList<Integer> f=new ArrayList<>();
        int c=0;
        int c1=0;
        for (int i = 0; i < n; i++) {
            x[i]=in.nextInt();
            y[i]=x[i];
        }
        Arrays.sort(y);
        boolean tt = true;
        if (tt) {

        for (int i = 0,j=n-1; i < n; i++,j--) {
            if (x[i]!=y[j]) {
                c1++;
            if (c1>2) {
                tt=false;break;
            }
            f.add(i+1);
            }

        }

        if (c1==2) {
            Collections.sort(f);
            System.out.println("yes");
            System.out.println(f.get(0)+" "+f.get(1));
        }else if(c1==0){System.out.println("yes"); System.out.println("1 "+n);}

        }
        if (tt==false) {

        for (int i = 0; i < n; i++) {
            if (x[i]!=y[i]) {
                c++;
            if (c>2) {
                System.out.println("no");break;
            }
            z.add(i+1);
            }

        }
        Collections.sort(z);
        if (c==2) {
            System.out.println("yes");
            System.out.println(z.get(0)+" "+z.get(1));
        }else if(c==0){System.out.println("yes"); System.out.println(x[0]+" "+x[0]);}

        }
    }

}


import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Scanner;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author uuu
 */
public class SorttheArray451b {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int[]x=new int[n];
        int[]y=new int[n];
        ArrayList<Integer> z=new ArrayList<>();
        int c=0;
        for (int i = 0; i < n; i++) {
            x[i]=in.nextInt();
            y[i]=x[i];
        }
        Arrays.sort(y);

        for (int i = 0; i < n; i++) {
            if (x[i]!=y[i]) {
                c++;
            if (c>2) {
                System.out.println("no");break;
            }
            z.add(x[i]);
            }

        }
        Collections.sort(z);
        if (c==2) {
            System.out.println("yes");
            System.out.println(z.get(0)+" "+z.get(1));
        }else if(c==0){System.out.println(x[0]+" "+x[0]);}

    }

}


import java.util.Scanner;
public class SorttheArray451b {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int[]x=new int[n];
        boolean tt = true;
        int z=0;
        int b=0;
        for (int i = 0; i < n; i++) {
            x[i]=in.nextInt();
        }
        for (int i = 0; i <n-1; i++) {
            if (x[i]>x[i+1]) {
                z=i+1;break;
            }}
        for (int j=n-1; j>0;j--) {
            if (x[j]<x[j-1]) {
                b=j+1;break;
            }
        }
        if(z==0||b==0){
            System.out.println("yes");
            System.out.println("1 1");
            return;

        }
            for (int i = z-1,j=b-1;i<j; i++,j--) {
            int temp = x[i];
            x[i]=x[j];
            x[j]=temp;

        }
            for (int i = 0; i < x.length-1; i++) {
                if (x[i]>x[i+1]) {
                    tt=false;break;
                }
        }
           if (tt) {
               System.out.println("yes");
               System.out.println(z+" "+b);
        }else System.out.println("no");
    }

}


import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Scanner;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author uuu
 */
public class SorttheArray451b {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int[]x=new int[n];
        int[]y=new int[n];
        ArrayList<Integer> z=new ArrayList<>();
        ArrayList<Integer> f=new ArrayList<>();
        int c=0;
        int c1=0;
        for (int i = 0; i < n; i++) {
            x[i]=in.nextInt();
            y[i]=x[i];
        }
        Arrays.sort(y);
        boolean tt = true;
        if (tt) {

        for (int i = 0,j=n-1; i < n; i++,j--) {
            if (x[i]!=y[j]) {
                c1++;
            if (c1>2) {
                tt=false;break;
            }
            f.add(i+1);
            }

        }
        Collections.sort(f);
        if (c1==2) {
            System.out.println("yes");
            System.out.println(f.get(0)+" "+f.get(1));
        }else if(c1==0){System.out.println("yes"); System.out.println("1 "+n);}

        }
        if (tt==false) {

        for (int i = 0; i < n; i++) {
            if (x[i]!=y[i]) {
                c++;
            if (c>2) {
                System.out.println("no");break;
            }
            z.add(i+1);
            }

        }
        Collections.sort(z);
        if (c==2) {
            System.out.println("yes");
            System.out.println(z.get(0)+" "+z.get(1));
        }else if(c==0){System.out.println("yes"); System.out.println(x[0]+" "+x[0]);}

        }
    }

}


import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Scanner;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author uuu
 */
public class SorttheArray451b {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int[]x=new int[n];
        int[]y=new int[n];
        ArrayList<Integer> z=new ArrayList<>();
        int c=0;
        for (int i = 0; i < n; i++) {
            x[i]=in.nextInt();
            y[i]=x[i];
        }
        Arrays.sort(y);

        for (int i = 0; i < n; i++) {
            if (x[i]!=y[i]) {
                c++;
            if (c>2) {
                System.out.println("no");break;
            }
            z.add(x[i]);
            }

        }
        Collections.sort(z);
        if (c==2) {
            System.out.println("yes");
            System.out.println(z.get(0)+" "+z.get(1));
        }else if(c==0){System.out.println("yes"); System.out.println(x[0]+" "+x[0]);}

    }

}


import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Scanner;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author uuu
 */
public class SorttheArray451b {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int[]x=new int[n];
        int[]y=new int[n];
        int[]d=new int[n];
        boolean tt = true;
        ArrayList<Integer> z=new ArrayList<>();
        ArrayList<Integer> f=new ArrayList<>();
        for (int i = 0; i < n; i++) {
            x[i]=in.nextInt();
            y[i]=x[i];
            d[i]=x[i];
        }

        Arrays.sort(y);
        for (int i = 0,j=n-1; i <n-1; i++,j--) {
            if (x[i]>x[i+1]) {
                z.add(i+1);
            }
            if (x[j]<x[j-1]) {
                f.add(j+1);
            }
        }

        if (z.size()==0||f.size()==0) {
            System.out.println("yes");
            System.out.println("1 1");
            return;
        }
            for (int i = z.get(0)-1,j=f.get(0)-1;i<j; i++,j--) {
            int temp = d[i];
            d[i]=d[j];
            d[j]=temp;

        }
            for (int i = 0; i < x.length; i++) {
                if (y[i]!=d[i]) {
                    tt=false;break;
                }
        }
           if (tt) {
               System.out.println("yes");
               System.out.println(z.get(0)+" "+f.get(0));
        }else System.out.println("no");

    }

}


import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Scanner;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author uuu
 */
public class SorttheArray451b {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int[]x=new int[n];
        int[]y=new int[n];
        ArrayList<Integer> z=new ArrayList<>();
        ArrayList<Integer> f=new ArrayList<>();
        int c=0;
        int c1=0;
        for (int i = 0; i < n; i++) {
            x[i]=in.nextInt();
            y[i]=x[i];
        }
        Arrays.sort(y);
        boolean tt = true;
        if (tt) {

        for (int i = 0,j=n-1; i < n; i++,j--) {
            if (x[i]!=y[j]) {
                c1++;
            if (c1>2) {
                tt=false;break;
            }
            f.add(i+1);
            }

        }

        if (c1==2) {
            Collections.sort(f);
            System.out.println("yes");
            System.out.println(f.get(0)+" "+f.get(1));
        }else if(c1==0){System.out.println("yes"); System.out.println("1 "+n);}

        }
        if (tt==false) {

        for (int i = 0; i < n; i++) {
            if (x[i]!=y[i]) {
                c++;
            if (c>2) {
                System.out.println("no");break;
            }
            z.add(i+1);
            }

        }
        Collections.sort(z);
        if (c==2) {
            System.out.println("yes");
            System.out.println(z.get(0)+" "+z.get(1));
        }else if(c==0){System.out.println("yes"); System.out.println(x[0]+" "+x[0]);}

        }
    }

}


/* package whatever; // don't place package name! */

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

/* Name of the class has to be "Main" only if the class is public. */
public final class Ideone
{
	public static void main (String[] args) throws java.lang.Exception
	{
		// your code goes here
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		String s1[] = br.readLine().split(" ");
		int a[] = new int[n];
		for(int i = 0; i < n ; i++)
		{
			a[i] = Integer.parseInt(s1[i]);
		}
		int l = 0;
		int f = 0;
		int v = 0;
		int q = 0;
		inner:
		for(int i = 0 ;i < n - 1 ; i++){
			//System.out.println(i);
			if(a[i] < a[i+1])
				continue;
			else
			{
				if(v == 0){
					v++;
					l = i;
					outer:
					for(int j = i ; j < n-1 ; j++){
						//System.out.println(j);
						if(a[j] > a[j+1]){
							i = j;
							f = j+1;
							continue;
						}
						else{
							f = j;
							i = j - 1;
							//System.out.println("here");
							Arrays.sort(a,l,f+1);
							//System.out.println("here2222");
							break outer;
						}
					}
				}
				else
				{
					q = 1;
					System.out.println("no");
					break inner;
				}
			}

		}
		if( q==0)
		{
			if (l == 0){
				System.out.println("yes");
				System.out.println((l+1) + " "+(f+1));
			}
			//System.out.printf("%s\n",Arrays.toString(a));
			if (l > 0 && (a[l] < a[l - 1])){
				System.out.println("yes");
				System.out.println((l+1) + " "+(f+1));
			}
			if(l > 0 && (a[l] > a[l-1]))
				System.out.println("no");
		}
	}
}


/* package whatever; // don't place package name! */

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

/* Name of the class has to be "Main" only if the class is public. */
public final class Ideone
{
	public static void main (String[] args) throws java.lang.Exception
	{
		// your code goes here
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		String s1[] = br.readLine().split(" ");
		int a[] = new int[n];
		for(int i = 0; i < n ; i++)
		{
			a[i] = Integer.parseInt(s1[i]);
		}
		int l = 0;
		int f = 0;
		int v = 0;
		int q = 0;
		inner:
		for(int i = 0 ;i < n - 1 ; i++){
			//System.out.println(i);
			if(a[i] < a[i+1])
				continue;
			else
			{
				if(v == 0){
					v++;
					l = i;
					outer:
					for(int j = i ; j < n-1 ; j++){
						//System.out.println(j);
						if(a[j] > a[j+1]){
							i = j;
							f = j+1;
							continue;
						}
						else{
							f = j;
							i = j - 1;
							//System.out.println("here");
							Arrays.sort(a,l,f+1);
							//System.out.println("here2222");
							break outer;
						}
					}
				}
				else
				{
					q = 1;
					System.out.println("no");
					break inner;
				}
			}

		}
		if( q==0)
		{
			System.out.println("yes");
			System.out.println((l+1) + " "+(f+1));
			//System.out.printf("%s\n",Arrays.toString(a));
		}
	}
}


/* package whatever; // don't place package name! */

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

/* Name of the class has to be "Main" only if the class is public. */
public final class Ideone
{
	public static void main (String[] args) throws java.lang.Exception
	{
		// your code goes here
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		String s1[] = br.readLine().split(" ");
		int a[] = new int[n];
		for(int i = 0; i < n ; i++)
		{
			a[i] = Integer.parseInt(s1[i]);
		}
		int l = 0;
		int f = 0;
		int v = 0;
		int q = 0;
		inner:
		for(int i = 0 ;i < n - 1 ; i++){
			//System.out.println(i);
			if(a[i] < a[i+1])
				continue;
			else
			{
				if(v == 0){
					v++;
					l = i;
					outer:
					for(int j = i ; j < n-1 ; j++){
						//System.out.println(j);
						if(a[j] > a[j+1]){
							i = j;
							f = j+1;
							continue;
						}
						else{
							f = j;
							i = j - 1;
							//System.out.println("here");
							Arrays.sort(a,l,f+1);
							//System.out.println("here2222");
							break outer;
						}
					}
					Arrays.sort(a,l,f+1);
				}
				else
				{
					q = 1;
					System.out.println("no");
					break inner;
				}
			}

		}
		if( q==0)
		{
			if (l == 0){
				System.out.println("yes");
				System.out.println((l+1) + " "+(f+1));
			}
			//System.out.printf("%s\n",Arrays.toString(a));
			if (l > 0 && (a[l] > a[l - 1])){
				System.out.println("yes");
				System.out.println((l+1) + " "+(f+1));
				//System.out.printf("%s\n",Arrays.toString(a));
			}
			if(l > 0 && (a[l] < a[l-1]))
				System.out.println("no");
		}
	}
}