The Little Elephant has got a problem — somebody has been touching his sorted by non-decreasing array a of length n and possibly swapped some elements of the array.

The Little Elephant doesn't want to call the police until he understands if he could have accidentally changed the array himself. He thinks that he could have accidentally changed array a, only if array a can be sorted in no more than one operation of swapping elements (not necessarily adjacent). That is, the Little Elephant could have accidentally swapped some two elements.

Help the Little Elephant, determine if he could have accidentally changed the array a, sorted by non-decreasing, himself.

Input

The first line contains a single integer n (2 ≤ n ≤ 105) — the size of array a. The next line contains n positive integers, separated by single spaces and not exceeding 109, — array a.

Note that the elements of the array are not necessarily distinct numbers.

Output

In a single line print "YES" (without the quotes) if the Little Elephant could have accidentally changed the array himself, and "NO" (without the quotes) otherwise.

Examples

Input

2
1 2


Output

YES


Input

3
3 2 1


Output

YES


Input

4
4 3 2 1


Output

NO

Note

In the first sample the array has already been sorted, so to sort it, we need 0 swap operations, that is not more than 1. Thus, the answer is "YES".

In the second sample we can sort the array if we swap elements 1 and 3, so we need 1 swap operation to sort the array. Thus, the answer is "YES".

In the third sample we can't sort the array in more than one swap operation, so the answer is "NO".
import java.io.*;
import java.util.*;
 
public class Main {
    public static String reverse(String name){
       if(name==null||name.length()<=1)
           return name;
       return reverse(name.substring(1))+name.charAt(0)
               ;
     
       
          
    }
 
    public static void main(String args[]) throws FileNotFoundException, IOException  {
                    Scanner Reader = new Scanner(System.in);
                       int n = Reader.nextInt(); 
                       int [] ar = new int [n];
                       int [] ar2= new int [n];
                       for (int i = 0; i < n; i++) {
             ar[i] = ar2[i] =Reader.nextInt();
        }    Random rnd = new Random(System.nanoTime());
		for (int i = 1; i < n; ++i) {
			int j = rnd.nextInt(i);
			int tmp = ar2[j];
			ar2[j] = ar2[i];
			ar2[i] = tmp;
		}
                       int ind = -1;
        Arrays.sort(ar2);
                     //  if(isSorted(ar,ar2)){
                     //      System.out.println("YES");
                    //   }
                 
                     //  else {
                          // int max = Integer.MIN_VALUE;
                           for (int i = 0; i < n; i++) {
                               if(ar[i]!=ar2[i])
                               {   
                                   ind = i;
                               break;}
                           }
                          // int min = Integer.MAX_VALUE; 
                           int mini = -1;
                           for (int i = n-1; i>=0; i--) {
                               if(ar[i]!=ar2[i]){
                                  
                                   mini = i;
                                   break;
                               }
                           }
                           if(mini!=-1&&ind!=-1&&mini!=ind){
                           int temp = ar[ind];
                           ar[ind] = ar[mini];
                           ar[mini] = temp;}
                           if(isSorted(ar,ar2))
                               System.out.println("YES");
                           else System.out.println("NO");
                    //   }
          
        
        }

    private static boolean isSorted(int[] ar,int[]ar2) {
          for (int i = 0; i < ar.length; i++) {
            if(ar[i]!=ar2[i])
                return false;
        }
          return true;
        
//throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }
          }
          
      
 
 
 
    
 
 
 
 
   /*  public static  long dfs(int i){
         long   sum=0;
         try {
        v[i] =true;
   sum=p[i];
         for (int j = 0; j < g[i].size(); j++) {
             if(v[g[i].get(j)]==false){
                // sum+=p[g[i].get(j)];
                 sum+=dfs(g[i].get(j));
             }
         } }
         catch(Exception e ){
             System.out.println("DFS Exception");
         }
         return sum;
    }
 
   */
 
 

class InputReader {
    private InputStream stream;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;
    private SpaceCharFilter filter;
 
    public InputReader(InputStream stream) {
        this.stream = stream;
    }
 
    public static boolean isWhitespace(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }
 
    public int read() {
        if (numChars == -1)
            throw new InputMismatchException();
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
 if (numChars <= 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 {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            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 {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }
 
    public String nextToken() {
        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 boolean isSpaceChar(int c) {
        if (filter != null)
            return filter.isSpaceChar(c);
        return isWhitespace(c);
    }
 
    public interface SpaceCharFilter {
        public boolean isSpaceChar(int ch);
    }
}
    class sotork implements Comparable<sotork> {
char op ;
        long price, vol,totalv;

        public sotork(char op ,long  price, long  vol) {
            this.op = op;
            this.price = price;
            this.vol = vol;
        }

        @Override
        public int compareTo(sotork o) {
            return Long.compare(this.price, o.price);
        }

    }

class Reader {

    static BufferedReader reader;
    static StringTokenizer tokenizer;

    /**
     * call this method to initialize reader for InputStream
     */
    static void init(InputStream input) {
        reader = new BufferedReader(
                new InputStreamReader(input));
        tokenizer = new StringTokenizer("");
    }

    /**
     * get next word
     */
    static String next() throws IOException {
        while (!tokenizer.hasMoreTokens()) {
            //TODO add check for eof if necessary
            tokenizer = new StringTokenizer(
                    reader.readLine());
        }
        return tokenizer.nextToken();
    }

    static int nextInt() throws IOException {
        return Integer.parseInt(next());
    }

    static double nextDouble() throws IOException {
        return Double.parseDouble(next());
    }

    static public void nextIntArrays(int[]... arrays) throws IOException {
        for (int i = 1; i < arrays.length; ++i) {
            if (arrays[i].length != arrays[0].length) {
                throw new InputMismatchException("Lengths are different");
            }
        }
        for (int i = 0; i < arrays[0].length; ++i) {
            for (int[] array : arrays) {
                array[i] = nextInt();
            }
        }
    }
}
