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:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

/**
 * @author Don Li
 */
public class ANDPermutations {
    void solve() {
        int n = in.nextInt();
        
        findP(n);
        findQ(n);
    }
    
    void findP(int n) {
        if ((n & 1) > 0) {
            out.println("NO");
            return;
        }
        
        int[] res = new int[n + 1];
        while (n > 0) {
            int x = Integer.highestOneBit(n);
            for (int i = 0; i <= n - x; i++) {
                res[x + i] = x - i - 1;
                res[x - i - 1] = x + i;
            }
            n = x * 2 - n - 2;
        }
        
        out.println("YES");
        for (int i = 1; i < res.length; i++) {
            if (i > 1) out.print(' ');
            out.print(res[i]);
        }
        out.println();
    }
    
    void findQ(int n) {
        if (Integer.bitCount(n) == 1) {
            out.println("NO");
            return;
        }
        
        if (n <= 5) {
            out.println("NO");
            return;
        }
        
        if (n == 6) {
            out.println("YES");
            out.println("3 6 2 5 1 4");
            return;
        }
        
        if (n == 7) {
            out.println("YES");
            out.println("7 3 6 5 1 2 4");
            return;
        }
        
        out.println("YES");
        out.print("7 3 6 5 1 2 4 ");
        for (int x = 8; x <= n; x <<= 1) {
            int lim = Math.min((x << 1) - 1, n);
            out.print(lim + " ");
            for (int i = x; i < lim; i++) out.print(i + " ");
        }
        out.println();
    }
    
    public static void main(String[] args) {
        in = new FastScanner(new BufferedReader(new InputStreamReader(System.in)));
        out = new PrintWriter(System.out);
        new ANDPermutations().solve();
        out.close();
    }
    
    static FastScanner in;
    static PrintWriter out;
    
    static class FastScanner {
        BufferedReader in;
        StringTokenizer st;
        
        public FastScanner(BufferedReader in) {
            this.in = in;
        }
        
        public String nextToken() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(in.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
        
        public int nextInt() {
            return Integer.parseInt(nextToken());
        }
        
        public long nextLong() {
            return Long.parseLong(nextToken());
        }
        
        public double nextDouble() {
            return Double.parseDouble(nextToken());
        }
    }
}