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


public class Main {
    static Scanner sc = new Scanner(System.in);
    public static void main(String args[]) {
        int n = sc.nextInt();
        int[] p = new int[n];
        for(int i = 0; i < n; i++) p[i] = sc.nextInt();
        boolean ans = false;
        boolean ok = true;
        for(int i = 0; i < n; i++) {
            for(int j = 0; j < n; j++) {
                int tmp = p[i];
                p[i] = p[j];
                p[j] = tmp;
                ok = true;


                for(int k = 0; k < n - 1; k++) {
                    if(p[k] >= p[k + 1]) {
                        ok = false;
                        break;
                    }
                }
                ans |= ok;
                p[j] = p[i];
                p[i] = tmp;
            }
        }

        System.out.println(ans?"YES":"NO");

    } 
} import java.util.*; util.* java import java.math.*; math.* java import java.io.*; io.* java public class Main {
    static Scanner sc = new Scanner(System.in);
    public static void main(String args[]) {
        int n = sc.nextInt();
        int[] p = new int[n];
        for(int i = 0; i < n; i++) p[i] = sc.nextInt();
        boolean ans = false;
        boolean ok = true;
        for(int i = 0; i < n; i++) {
            for(int j = 0; j < n; j++) {
                int tmp = p[i];
                p[i] = p[j];
                p[j] = tmp;
                ok = true;


                for(int k = 0; k < n - 1; k++) {
                    if(p[k] >= p[k + 1]) {
                        ok = false;
                        break;
                    }
                }
                ans |= ok;
                p[j] = p[i];
                p[i] = tmp;
            }
        }

        System.out.println(ans?"YES":"NO");

    } 
} Main static Scanner sc = new Scanner(System.in); sc new Scanner(System.in) public static void main(String args[]) {
        int n = sc.nextInt();
        int[] p = new int[n];
        for(int i = 0; i < n; i++) p[i] = sc.nextInt();
        boolean ans = false;
        boolean ok = true;
        for(int i = 0; i < n; i++) {
            for(int j = 0; j < n; j++) {
                int tmp = p[i];
                p[i] = p[j];
                p[j] = tmp;
                ok = true;


                for(int k = 0; k < n - 1; k++) {
                    if(p[k] >= p[k + 1]) {
                        ok = false;
                        break;
                    }
                }
                ans |= ok;
                p[j] = p[i];
                p[i] = tmp;
            }
        }

        System.out.println(ans?"YES":"NO");

    } main {
        int n = sc.nextInt();
        int[] p = new int[n];
        for(int i = 0; i < n; i++) p[i] = sc.nextInt();
        boolean ans = false;
        boolean ok = true;
        for(int i = 0; i < n; i++) {
            for(int j = 0; j < n; j++) {
                int tmp = p[i];
                p[i] = p[j];
                p[j] = tmp;
                ok = true;


                for(int k = 0; k < n - 1; k++) {
                    if(p[k] >= p[k + 1]) {
                        ok = false;
                        break;
                    }
                }
                ans |= ok;
                p[j] = p[i];
                p[i] = tmp;
            }
        }

        System.out.println(ans?"YES":"NO");

    } int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int[] p = new int[n]; p new int[n] n for(int i = 0; i < n; i++) p[i] = sc.nextInt(); int i = 0; int i = 0; i 0 i < n i n i++ i++ i p[i] = sc.nextInt(); p[i] = sc.nextInt() p[i] p i sc.nextInt() sc.nextInt sc boolean ans = false; ans false boolean ok = true; ok true for(int i = 0; i < n; i++) {
            for(int j = 0; j < n; j++) {
                int tmp = p[i];
                p[i] = p[j];
                p[j] = tmp;
                ok = true;


                for(int k = 0; k < n - 1; k++) {
                    if(p[k] >= p[k + 1]) {
                        ok = false;
                        break;
                    }
                }
                ans |= ok;
                p[j] = p[i];
                p[i] = tmp;
            }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            for(int j = 0; j < n; j++) {
                int tmp = p[i];
                p[i] = p[j];
                p[j] = tmp;
                ok = true;


                for(int k = 0; k < n - 1; k++) {
                    if(p[k] >= p[k + 1]) {
                        ok = false;
                        break;
                    }
                }
                ans |= ok;
                p[j] = p[i];
                p[i] = tmp;
            }
        } {
            for(int j = 0; j < n; j++) {
                int tmp = p[i];
                p[i] = p[j];
                p[j] = tmp;
                ok = true;


                for(int k = 0; k < n - 1; k++) {
                    if(p[k] >= p[k + 1]) {
                        ok = false;
                        break;
                    }
                }
                ans |= ok;
                p[j] = p[i];
                p[i] = tmp;
            }
        } for(int j = 0; j < n; j++) {
                int tmp = p[i];
                p[i] = p[j];
                p[j] = tmp;
                ok = true;


                for(int k = 0; k < n - 1; k++) {
                    if(p[k] >= p[k + 1]) {
                        ok = false;
                        break;
                    }
                }
                ans |= ok;
                p[j] = p[i];
                p[i] = tmp;
            } int j = 0; int j = 0; j 0 j < n j n j++ j++ j {
                int tmp = p[i];
                p[i] = p[j];
                p[j] = tmp;
                ok = true;


                for(int k = 0; k < n - 1; k++) {
                    if(p[k] >= p[k + 1]) {
                        ok = false;
                        break;
                    }
                }
                ans |= ok;
                p[j] = p[i];
                p[i] = tmp;
            } {
                int tmp = p[i];
                p[i] = p[j];
                p[j] = tmp;
                ok = true;


                for(int k = 0; k < n - 1; k++) {
                    if(p[k] >= p[k + 1]) {
                        ok = false;
                        break;
                    }
                }
                ans |= ok;
                p[j] = p[i];
                p[i] = tmp;
            } int tmp = p[i]; tmp p[i] p i p[i] = p[j] p[i] p i p[j] p j p[j] = tmp p[j] p j tmp ok = true ok true for(int k = 0; k < n - 1; k++) {
                    if(p[k] >= p[k + 1]) {
                        ok = false;
                        break;
                    }
                } int k = 0; int k = 0; k 0 k < n - 1 k n - 1 n 1 k++ k++ k {
                    if(p[k] >= p[k + 1]) {
                        ok = false;
                        break;
                    }
                } {
                    if(p[k] >= p[k + 1]) {
                        ok = false;
                        break;
                    }
                } if(p[k] >= p[k + 1]) {
                        ok = false;
                        break;
                    } p[k] >= p[k + 1] p[k] p k p[k + 1] p k + 1 k 1 {
                        ok = false;
                        break;
                    } ok = false ok false break; ans |= ok ans ok p[j] = p[i] p[j] p j p[i] p i p[i] = tmp p[i] p i tmp System.out.println(ans?"YES":"NO") System.out.println System.out System System.out ans?"YES":"NO" ans "YES" "NO" String args[] args public class Main {
    static Scanner sc = new Scanner(System.in);
    public static void main(String args[]) {
        int n = sc.nextInt();
        int[] p = new int[n];
        for(int i = 0; i < n; i++) p[i] = sc.nextInt();
        boolean ans = false;
        boolean ok = true;
        for(int i = 0; i < n; i++) {
            for(int j = 0; j < n; j++) {
                int tmp = p[i];
                p[i] = p[j];
                p[j] = tmp;
                ok = true;


                for(int k = 0; k < n - 1; k++) {
                    if(p[k] >= p[k + 1]) {
                        ok = false;
                        break;
                    }
                }
                ans |= ok;
                p[j] = p[i];
                p[i] = tmp;
            }
        }

        System.out.println(ans?"YES":"NO");

    } 
} public class Main {
    static Scanner sc = new Scanner(System.in);
    public static void main(String args[]) {
        int n = sc.nextInt();
        int[] p = new int[n];
        for(int i = 0; i < n; i++) p[i] = sc.nextInt();
        boolean ans = false;
        boolean ok = true;
        for(int i = 0; i < n; i++) {
            for(int j = 0; j < n; j++) {
                int tmp = p[i];
                p[i] = p[j];
                p[j] = tmp;
                ok = true;


                for(int k = 0; k < n - 1; k++) {
                    if(p[k] >= p[k + 1]) {
                        ok = false;
                        break;
                    }
                }
                ans |= ok;
                p[j] = p[i];
                p[i] = tmp;
            }
        }

        System.out.println(ans?"YES":"NO");

    } 
} Main
import java.util.*;
import java.math.*;
import java.io.*;


public class Main {
    static Scanner sc = new Scanner(System.in);
    public static void main(String args[]) {
        int n = sc.nextInt();
        int[] p = new int[n];
        for(int i = 0; i < n; i++) p[i] = sc.nextInt();
        boolean ans = false;
        boolean ok = true;
        for(int i = 0; i < n; i++) {
            for(int j = 0; j < n; j++) {
                int tmp = p[i];
                p[i] = p[j];
                p[j] = tmp;
                ok = true;


                for(int k = 0; k < n - 1; k++) {
                    if(p[k] >= p[k + 1]) {
                        ok = false;
                        break;
                    }
                }
                ans |= ok;
                p[j] = p[i];
                p[i] = tmp;
            }
        }

        System.out.println(ans?"YES":"NO");

    } 
}