Problem: Given an integer N, find two permutations:

  1. Permutation p of numbers from 1 to N such that pi ≠ i and pi & i = 0 for all i = 1, 2, ..., N. 
  2. Permutation q of numbers from 1 to N such that qi ≠ i and qi & i ≠ 0 for all i = 1, 2, ..., N. 



& is the [bitwise AND operation](https://en.wikipedia.org/wiki/Bitwise_operation#AND).

Input

The input consists of one line containing a single integer N (1 ≤ N ≤ 105).

Output

For each subtask, if the required permutation doesn't exist, output a single line containing the word "NO"; otherwise output the word "YES" in the first line and N elements of the permutation, separated by spaces, in the second line. If there are several possible permutations in a subtask, output any of them.

Examples

Input

3


Output

NO
NO


Input

6


Output

YES
6 5 4 3 2 1 
YES
3 6 2 5 1 4

Solution (in JAVA):

Solution:
/*
Keep solving problems.
*/

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

public class CFA {
    BufferedReader br;
    PrintWriter out;
    StringTokenizer st;
    boolean eof;
    private static final long MOD = 1000 * 1000 * 1000 + 7;
    private static final int[] dx = {0, -1, 0, 1};
    private static final int[] dy = {1, 0, -1, 0};
    private static final String yes = "YES";
    private static final String no = "NO";

    void solve() throws IOException {
        int n = nextInt();
        solve1(n);
        solve2(n);
    }

    void solve1(int n) {
        if (n % 2 == 1) {
            outln(no);
            return;
        }

        int[] res = new int[n];
        while (n > 0) {
            int start = 1;
            while (start <= n) {
                start = 2 * start;
            }
            start = start / 2;
            int i = 0;
            while (i + start <= n) {
                int left = start - 1 - i;
                int right = start + i;
                res[left - 1] = right;
                res[right - 1] = left;
                i++;
            }

            n = start - 1 - i;
        }

        outln(yes);
        for (int i = 0; i < res.length; i++) {
            out(res[i] + " ");
        }
        outln("");
    }

    void solve2(int n) {
        if (n <= 5) {
            outln(no);
            return;
        }

        int[] res6 = {3, 6, 2, 5, 1, 4};
        int[] res7 = {7, 3, 6, 5, 1, 2, 4};
        if (n == 6) {
            outln(yes);
            for (int i = 0; i < n; i++) {
                out(res6[i] + " ");
            }
            return;
        }
        else if (n == 7) {
            outln(yes);
            for (int i = 0; i < n; i++) {
                out(res7[i] + " ");
            }
            return;
        }

        int start = 1;
        while (start <= n) {
            start = 2 * start;
        }
        start = start / 2;
        if (start == n) {
            out(no);
            return;
        }

        int[] res = new int[n];
        for (int i = 0; i < 7; i++) {
            res[i] = res7[i];
        }

        start = 8;
        while (start <= n) {
            int left = start;
            int right = start * 2 - 1;
            right = Math.min(right, n);
            for (int i = left; i < right; i++) {
                res[i - 1] = i + 1;
            }
            res[right - 1] = left;

            start = right + 1;
        }

        outln(yes);
        for (int i = 0; i < n; i++) {
            out(res[i] + " ");
        }
    }

    void shuffle(int[] a) {
        int n = a.length;
        for(int i = 0; i < n; i++) {
            int r = i + (int) (Math.random() * (n - i));
            int tmp = a[i];
            a[i] = a[r];
            a[r] = tmp;
        }
    }

    int gcd(int a, int b) {
        while(a != 0 && b != 0) {
            int c = b;
            b = a % b;
            a = c;
        }
        return a + b;
    }

    private void outln(Object o) {
        out.println(o);
    }
    private void out(Object o) {
        out.print(o);
    }
    public CFA() throws IOException {
        br = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);
        solve();
        out.close();
    }
    public static void main(String[] args) throws IOException {
        new CFA();
    }

    public long[] nextLongArr(int n) throws IOException{
        long[] res = new long[n];
        for(int i = 0; i < n; i++)
            res[i] = nextLong();
        return res;
    }
    public int[] nextIntArr(int n) throws IOException {
        int[] res = new int[n];
        for(int i = 0; i < n; i++)
            res[i] = nextInt();
        return res;
    }
    public String nextToken() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (Exception e) {
                eof = true;
                return null;
            }
        }
        return st.nextToken();
    }
    public String nextString() {
        try {
            return br.readLine();
        } catch (IOException e) {
            eof = true;
            return null;
        }
    }
    public int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }
    public long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }
    public double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }
}