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

public class Main implements Runnable{
    public static void main(String[] args){
        //new Thread(null,new Main(),"Thread-1",1024*1024*10).start();
        new Main().run();
    }
    int mod=1000000007;
    private void solve() throws Exception {
        InputReader in = new InputReader(System.in);
        PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
        int n=in.nextInt();
        long[][]dp=new long[n+1][n+1];
        dp[0][0]=1;
        for(int i=0;i<=n;i++){
            for(int j=i;j<=n;j++){
                if(j!=i)dp[i][j]+=dp[i][j-1];
                if(i!=0)dp[i][j]+=dp[i-1][j];
                dp[i][j]%=mod;
            }
        }
        long ans=0;
        for(int j=n;j>=0;j--){
            for(int i=j-1;i>=0;i-=2){
                ans+=dp[i][j];
                ans%=mod;
            }
        }
        out.println(ans);
        out.flush();
    }
    /*
    long get(int a,int turn){
        int x=(turn-a);
        if(x%2!=0)return 0;
        x/=2;
        return fac[turn]*inv[x]%mod*inv[turn-x]%mod;
    }
    void init(){
        int n=2000;
        inv[0]=fac[0]=fac[1]=1;
        for(int i=2;i<=n;i++)fac[i]=(fac[i-1]*i)%mod;
        inv[n]=pow(fac[n],mod-2);
        for(int i=n-1;i>=1;i--){
            inv[i]=(inv[i+1]*(i+1))%mod;
        }
    }
    long pow(long a,int b){
        long ans=1;
        while(b>0){
            if((b&1)==1)ans=(ans*a)%mod;
            a=(a*a)%mod;
            b>>=1;
        }
        return ans;
    }*/
    @Override
    public void run() {
        try {
            solve();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    class InputReader{
        StreamTokenizer tokenizer;
        public InputReader(InputStream stream){
            tokenizer=new StreamTokenizer(new BufferedReader(new InputStreamReader(stream)));
            tokenizer.ordinaryChars(33,126);
            tokenizer.wordChars(33,126);
        }
        public String next() throws IOException {
            tokenizer.nextToken();
            return tokenizer.sval;
        }
        public int nextInt() throws IOException {
            return Integer.parseInt(next());
        }
        public long nextLong() throws IOException {
            return Long.parseLong(next());
        }
        public boolean hasNext() throws IOException {
            int res=tokenizer.nextToken();
            tokenizer.pushBack();
            return res!=tokenizer.TT_EOF;
        }
    }
}


import java.util.Scanner;

public class Codeforces {
    final static int P = 1000000007;
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int n = input.nextInt();
        int[][] table = new int[n+1][n+1];
        table[0][0] = 0;
        for (int i=0; i<=n; i++) for (int j=i; j<=n; j++) {
            if (i == 0 && j == 0) continue;
            else if (i == 0) table[i][j] = (table[i][j-1]+(i+j&1))%P;
            else if (j == 0) table[i][j] = (table[i-1][j]+(i+j&1))/P;
            else table[i][j] = (table[i-1][j] + table[i][j-1] + (i+j&1))%P;
        }
        System.out.println(table[n][n]);
    }
}


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

// **** D. Neko and Aki's Prank ****

public class D {
	static char [] in = new char [1000000];
	static int MOD = 1000000007;
	static long modinv2 = BigInteger.valueOf(2).modInverse(BigInteger.valueOf(MOD)).longValue();
	static long [][][] dp = new long [2][2001][2001];
	public static void main (String [] arg) throws Throwable {
		int n = nextInt();
		for (int i = 0; i<dp[1].length; ++i) Arrays.fill(dp[0][i], -1);
		for (int i = 0; i<dp[1].length; ++i) Arrays.fill(dp[1][i], -1);

		long ans = recurse(0,0,0,2*n);
		System.out.println(( n == 1) ? 1 : ans % MOD);
	}
	public static long recurse( int pos, int k, int T, int n) {
		if (k < 0) return 0;
		if (k > n-pos) return 0;
		if (n == pos) return 0;
		if (dp[T][pos][k] != -1) return dp[T][pos][k];
		long ans = 0;
		if (T == 1) {
			ans = recurse(pos+1, k-1, 0, n) + recurse(pos+1, k+1, 0, n);
			//System.err.println("AT POS " + pos + " with k =" + k + " and T=1 ans is " + ans);
		} else {
			if (k >= 1 && k+1 <= n-pos-1) {
				long tmp1 = 1 + recurse(pos+1, k+1, 1, n) + recurse(pos+1, k-1, 0, n);
				long tmp2 = 1 + recurse(pos+1, k+1, 0, n) + recurse(pos+1, k-1, 1, n);

				ans = Math.max(tmp1, tmp2);
				long t1 = ans;
				long t2 = Math.min(tmp1, tmp2);
				if (t2 == 0 && t1 == MOD-1) ans = 0;
				if (t2 == 1 && t1 == MOD-1) ans = 1;
				if (t2 == 0 && t1 == MOD-2) ans = 0;
			} else if (k < 1) {
				ans = 1 + recurse(pos+1, k+1, 1, n);
			} else {
				ans = 1 + recurse(pos+1, k-1, 1, n);
			}
			//System.err.println("AT POS " + pos + " with k = " + k + "  ans is " + ans);
		}
		dp[T][pos][k] = ans % MOD;
		return dp[T][pos][k];
	}

	/************** FAST IO CODE FOLLOWS *****************/
	public static long nextLong() throws Throwable {
		long i = System.in.read();boolean neg = false;while (i < 45) i = System.in.read();if (i == 45) {neg=true;i=48;}i = i - 48;
		int j = System.in.read();while (j > 32) {i*=10;i+=j-48;j = System.in.read();}return (neg) ? -i : i;
	}
	public static int nextInt() throws Throwable {return (int)nextLong();}
	public static String next() throws Throwable {
		int i = 0; while (i < 40 && i != -1) i = System.in.read(); int cptr = 0; while (i >= 40) { in[cptr++] = (char)i; i = System.in.read();}
		return new String(in, 0,cptr);
	}
	/**** LIBRARIES ****/
	public static long gcdL(long a, long b) {while (b != 0) {long tmp = b;b = (a % b);a = tmp;}return a;}
	public static int gcd(int a, int b) {while (b != 0) {int tmp = b;b = (a % b);a = tmp;}return a;}
	public static int[] sieve(int LIM) {
		int i,count = 0;
		boolean [] b = new boolean [LIM];
		for (i = 2;i<LIM; ++i) if (!b[i]) {count++; for (int j = i<<1; j<LIM; j+=i) b[j] = true;}
		int [] primes = new int[count];
		for (i = 2,count=0;i<LIM;++i) if (!b[i]) primes[count++] = i;
		return primes;
	}
	public static int[] numPrimeFactors(int LIM) {
		int i,count = 0;
		int [] b = new int [LIM];
		for (i = 2;i<LIM; ++i) if (b[i] == 0) {count++; for (int j = i; j<LIM; j+=i) b[j]++;}
		return b;
	}
}

/* Full Problem Text:

Neko is playing with his toys on the backyard of Aki's house.
Aki decided to play a prank on him, by secretly putting catnip into Neko's toys.
Unfortunately, he went overboard and put an entire bag of catnip into the toys...
It took Neko an entire day to turn back to normal.
Neko reported to Aki that he saw a lot of weird things, including a trie of all correct bracket sequences of length 2n.
The definition of correct bracket sequence is as follows:

 The empty sequence is a correct bracket sequence,
 If s is a correct bracket sequence, then (\,s\,) is a correct bracket sequence,
 If s and t are a correct bracket sequence, then st is also a correct bracket sequence.
For example, the strings "(())", "()()" form a correct bracket sequence, while ")(" and "((" not.
Aki then came up with an interesting problem: What is the size of the maximum matching (the largest set of edges with disjoint ends) in this trie? Since the answer can be quite large, print it modulo 10^9 + 7.

 */


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

public class Kek {
    static Scanner scan = new Scanner(System.in);

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

    static String nextString() {
        return scan.next();
    }

    public static void main(String[] args) throws IOException {
        long MOD = 1000000007L;
        int n = nextInt();
        long[][] d = new long[2 * n + 1][n + 2];
        d[0][0] = 1;
        for (int i = 1; i < 2 * n + 1; i++) {
            d[i][0] = (d[i - 1][1] % MOD);
            for (int j = 1; j < n + 1 && j + i <= 2 * n ; j++) {
                d[i][j] = (d[i - 1][j + 1] + d[i - 1][j - 1]) % MOD;
            }
        }
        long s = 0;
        for (int i = 2 * n - 1; i >= 0; i -= 2) {
            for (int j = 0; j < n + 1; j++) {
                s += d[i][j];
                s %= MOD;
            }
        }
        System.out.println(s);
    }
}


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 Andy Phan (Edited for speedups by AuroraGarden)
 */
public class p1152d {
    static boolean[][] hasVal;
    static boolean[][] doneVal;
    static long[][][] dp;
    static boolean[][][] done;

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        hasVal = new boolean[2*n+1][2*n+1];
        doneVal = new boolean[2*n+1][2*n+1];
        dp = new long[2*n+1][2*n+1][2];
        done = new boolean[2*n+1][2*n+1][2];
        System.out.println(traverse(2*n, 0, 0)%1_000_000_007);
    }

    public static long traverse(int ind, int diff, int flag) {
        if(ind <= 0 || diff < 0) return 0;
        if(done[ind][diff][flag]) return dp[ind][diff][flag];
        done[ind][diff][flag] = true;
        long num = 0;
        if(flag == 1) {
            if(hasVal(ind-1, diff-1)) num += traverse(ind-1, diff-1, 0);
            if(hasVal(ind-1, diff+1)) num += traverse(ind-1, diff+1, 0);
            if(num >= 1_000_000_007) num -= 1_000_000_007;
            return dp[ind][diff][flag] = num;
        }
        if(hasVal(ind-1, diff-1)) {
            long tmp = traverse(ind-1, diff-1, 1)+1;
            if(hasVal(ind-1, diff+1)) tmp += traverse(ind-1, diff+1, 0);
            num = max(num, tmp);
        }
        if(hasVal(ind-1, diff+1)) {
            long tmp = traverse(ind-1, diff+1, 1)+1;
            if(hasVal(ind-1, diff-1)) tmp += traverse(ind-1, diff-1, 0);
            num = max(num, tmp);
        }
        if(num >= 1_000_000_007) num -= 1_000_000_007;
        return dp[ind][diff][flag] = num;
    }
    static long max(long a, long b) {return a > b ? a : b;}

    public static boolean hasVal(int ind, int diff) {
        if(diff < 0) return false;
        return diff <= ind;
    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;
import java.io.BufferedReader;
import java.util.Comparator;
import java.util.Collections;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskF solver = new TaskF();
        solver.solve(1, in, out);
        out.close();
    }
    static class TaskF {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int N = in.nextInt();
            int MOD = 1_000_000_007;
            int[][] dp1 = new int[N+1][N+1];
            int[][] dp2 = new int[N+1][N+1];

            for (int x = N; x >= 0; --x)
                for (int y = N; y >= 0; --y) {
                    int d1=0;
                    int d2=0;
                    // calc d2
                    if (x+1 <= N) {
                        int m = Math.max(dp1[x+1][y], dp2[x+1][y]);
                        d2 += m;
                    }
                    d2 %= MOD;
                    if (y+1 <= Math.min(x, N)) {
                        int m = Math.max(dp1[x][y+1], dp2[x][y+1]);
                        d2 += m;
                    }
                    d2 %= MOD;

                    if (x+1 <= N) {
                        int m = Math.max(dp1[x+1][y], dp2[x+1][y]);
                        d1 = Math.max(d1, 1+d2-m + dp2[x+1][y]);
                        d1 %= MOD;
                        if (d1 < 0) d1 += MOD;
                    }
                    if (y+1 <= Math.min(x, N)) {
                        int m = Math.max(dp1[x][y+1], dp2[x][y+1]);
                        d1 = Math.max(d1, 1+d2-m + dp2[x][y+1]);
                        d1 %= MOD;
                        if (d1 < 0) d1 += MOD;
                    }
                    d1 %= MOD;
                    if (d1 < 0) d1 += MOD;
                    d2 %= MOD;
                    if (d2 < 0) d2 += MOD;

                    dp1[x][y]=d1;
                    dp2[x][y]=d2;
                }

            int ans = Math.max(dp1[0][0], dp2[0][0]);

            out.print("" + ans);
            out.println();

        }
    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}


//Created by Aminul on 4/24/2019.

import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;

import static java.lang.Math.max;

public class D {
    static int n;
    static long dp[][][], mod = (long) 1e9 + 7, inf = (long) 1e18;

    public static void main(String[] args) throws Exception {
        Scanner in = new Scanner(System.in);
        PrintWriter pw = new PrintWriter(System.out);
        n = in.nextInt();
        dp = new long[2][n + n + 1][n + n + 1];
        for (long a[][] : dp) for (long b[] : a) Arrays.fill(b, -1);
        pw.println(solve(0, 0, 0));
        pw.close();
    }

    static long solve(int last, int pos, int sum) {
        if (pos >= n + n) {
            if (sum == 0) return 0;
            return -inf;
        }
        if (dp[last][pos][sum] != -1) return dp[last][pos][sum];
        long ans = 0, a = 0, b = 0, rem = n + n - pos;
        if (rem >= sum + 1) a = max(0, solve(0, pos + 1, sum + 1));
        if (sum - 1 >= 0) b = max(0, solve(0, pos + 1, sum - 1));
        ans = max(ans, a + b);
        if (last == 0) {
            a = 0;
            b = 0;
            if (rem >= sum + 1) a = max(0, solve(1, pos + 1, sum + 1));
            if (sum - 1 >= 0) b = max(0, solve(1, pos + 1, sum - 1));
            ans = max(ans, 1 + a + b);
        }
        if (ans >= 0) ans %= mod;
        return dp[last][pos][sum] = ans;
    }

    static void debug(Object... obj) {
        System.err.println(Arrays.deepToString(obj));
    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.FilterInputStream;
import java.io.BufferedInputStream;
import java.io.InputStream;

/**
 * @author khokharnikunj8
 */

public class Main {
    public static void main(String[] args) {
        new Thread(null, new Runnable() {
            public void run() {
                new Main().solve();
            }
        }, "1", 1 << 26).start();
    }

    void solve() {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        ScanReader in = new ScanReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        DNekoAndAkisPrank solver = new DNekoAndAkisPrank();
        solver.solve(1, in, out);
        out.close();
    }

    static class DNekoAndAkisPrank {
        long mod = 1_000_000_000 + 7;

        public void solve(int testNumber, ScanReader in, PrintWriter out) {
            int n = in.scanInt();
            long[][] dp = new long[2 * n + 1][2 * n + 1];
            long ans = 0;
            dp[0][0] = 1;
            for (int i = 1; i <= 2 * n; i++) {
                for (int j = 0; j <= i; j++) {
                    if (j != 0) dp[i][j] = (dp[i][j] + (dp[i - 1][j - 1])) % mod;
                    if (j + 1 <= 2 * n) dp[i][j] = (dp[i][j] + dp[i - 1][j + 1]) % mod;
                }
                if (i % 2 == 1) for (int j = 0; j <= Math.min(i, 2 * n - i); j++) ans = (ans + dp[i][j]) % mod;
            }
            out.println(ans % mod);
        }

    }

    static class ScanReader {
        private byte[] buf = new byte[4 * 1024];
        private int index;
        private BufferedInputStream in;
        private int total;

        public ScanReader(InputStream inputStream) {
            in = new BufferedInputStream(inputStream);
        }

        private int scan() {
            if (index >= total) {
                index = 0;
                try {
                    total = in.read(buf);
                } catch (Exception e) {
                    e.printStackTrace();
                }
                if (total <= 0) return -1;
            }
            return buf[index++];
        }

        public int scanInt() {
            int integer = 0;
            int n = scan();
            while (isWhiteSpace(n)) n = scan();
            int neg = 1;
            if (n == '-') {
                neg = -1;
                n = scan();
            }
            while (!isWhiteSpace(n)) {
                if (n >= '0' && n <= '9') {
                    integer *= 10;
                    integer += n - '0';
                    n = scan();
                }
            }
            return neg * integer;
        }

        private boolean isWhiteSpace(int n) {
            if (n == ' ' || n == '\n' || n == '\r' || n == '\t' || n == -1) return true;
            else return false;
        }

    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.FilterInputStream;
import java.io.BufferedInputStream;
import java.io.InputStream;

/**
 * @author khokharnikunj8
 */

public class Main {
    public static void main(String[] args) {
        new Thread(null, new Runnable() {
            public void run() {
                new Main().solve();
            }
        }, "1", 1 << 26).start();
    }

    void solve() {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        ScanReader in = new ScanReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        DNekoAndAkisPrank solver = new DNekoAndAkisPrank();
        solver.solve(1, in, out);
        out.close();
    }

    static class DNekoAndAkisPrank {
        long mod = 1_000_000_000 + 7;

        public void solve(int testNumber, ScanReader in, PrintWriter out) {
            int n = in.scanInt();
            long[][] dp = new long[2 * n + 1][2 * n + 1];
            long ans = 0;
            dp[0][0] = 1;
            for (int i = 1; i <= 2 * n; i++) {
                for (int j = 0; j <= i; j++) {
                    if (j != 0) dp[i][j] = (dp[i][j] + (dp[i - 1][j - 1])) % mod;
                    if (j + 1 <= 2 * n) dp[i][j] = (dp[i][j] + dp[i - 1][j + 1]) % mod;
                }
                if (i % 2 == 1) for (int j = 0; j <= 2 * n - i; j++) ans = (ans + dp[i][j]) % mod;
            }
            out.println(ans % mod);
        }

    }

    static class ScanReader {
        private byte[] buf = new byte[4 * 1024];
        private int index;
        private BufferedInputStream in;
        private int total;

        public ScanReader(InputStream inputStream) {
            in = new BufferedInputStream(inputStream);
        }

        private int scan() {
            if (index >= total) {
                index = 0;
                try {
                    total = in.read(buf);
                } catch (Exception e) {
                    e.printStackTrace();
                }
                if (total <= 0) return -1;
            }
            return buf[index++];
        }

        public int scanInt() {
            int integer = 0;
            int n = scan();
            while (isWhiteSpace(n)) n = scan();
            int neg = 1;
            if (n == '-') {
                neg = -1;
                n = scan();
            }
            while (!isWhiteSpace(n)) {
                if (n >= '0' && n <= '9') {
                    integer *= 10;
                    integer += n - '0';
                    n = scan();
                }
            }
            return neg * integer;
        }

        private boolean isWhiteSpace(int n) {
            if (n == ' ' || n == '\n' || n == '\r' || n == '\t' || n == -1) return true;
            else return false;
        }

    }
}


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

public class Main {
    static class FastScanner {
        private BufferedReader bufferedReader;
        private StringTokenizer stringTokenizer;
        public FastScanner(InputStream inputStream){
            bufferedReader = new BufferedReader(new InputStreamReader(inputStream));
        }
        public String next() {
            while (stringTokenizer == null || !stringTokenizer.hasMoreTokens()){
                try {
                    stringTokenizer = new StringTokenizer(bufferedReader.readLine());
                } catch (IOException ignored){}
            }
            return stringTokenizer.nextToken();
        }
        public int nextInt() {
            return Integer.parseInt(next());
        }
        public long nextLong() {
            return Long.parseLong(next());
        }
        public double nextDouble() {
            return Double.parseDouble(next());
        }
    }

    static class Node implements Comparable {
        Node left;
        Node right;
        private int value;
        private char c;

        Node(Node left, Node right, char c, int value) {
            this.left = left;
            this.right = right;
            this.value = value;
            this.c = c;
        }

        @Override
        public int compareTo(Object o) {
            return Integer.compare(this.value, ((Node)o).value);
        }
    }

    private static int fib(int n, int m){
        if (n < 2) return n;
        int a = 0;
        int b = 1;
        for (int i=0;i<n-2;i++){
            int c = (a + b) % m;
            a = b;
            b = c;
        }
        return (a + b) % m;
    }

    static long gcd(long a, long b) {
        if (b == 0) return a;
        return gcd(b, a % b);
    }

    static long lcm(long a, long b) {
        return Math.abs(a * b) / gcd(a, b);
    }

    static long dp[][][] = new long[2][2001][2001];

    static long m = 1_000_000_000 + 7;

    static long f(int o, int n, boolean canUse) {
        int k = canUse ? 1 : 0;
        if (dp[k][o][n] == -1) {
            if (n == 0) return 0;
            int d = canUse ? 1 : 0;
            if (o == 0) {
                dp[k][o][n] = f(o + 1, n - 1, !canUse) + d;
            }
            else if (n == o) {
                dp[k][o][n] = f(o - 1, n - 1, !canUse) + d;
            }
            else if (canUse) {
                dp[k][o][n] = f(o + 1, n - 1, false) + 1 + f(o - 1, n - 1, true);
            }
            else {
                dp[k][o][n] = f(o + 1, n - 1, true) + f(o - 1, n - 1, true);
            }
        }
        return dp[k][o][n] % m;
    }

    public static void main(String[] args){
        FastScanner scanner = new FastScanner(System.in);
        PrintWriter printer = new PrintWriter(System.out);
        int n = scanner.nextInt() * 2;
        for (int i = 0; i < 2; i++) {
            for (int j = 0; j < 2001; j++) {
                for (int k = 0; k < 2001; k++) {
                    dp[i][j][k] = -1;
                }
            }
        }
        printer.println(f(0, n, true));
        printer.flush();
        printer.close();
    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {

    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        DNekoIPrank solver = new DNekoIPrank();
        solver.solve(1, in, out);
        out.close();
    }

    static class DNekoIPrank {

        static final int MOD = (int) 1e9 + 7;

        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt() * 2;
            int[][][] dp = new int[n + 1][n + 1][2]; // left, toClose, prev
            for (int i = 1; i <= n; i++) {
                for (int h = 0; h <= i; h++) {
                    if ((i - h) % 2 != 0) {
                        continue;
                    }
                    if (h + 1 <= i - 1) {
                        dp[i][h][0] = (dp[i - 1][h + 1][1] + 1) % MOD;
                        dp[i][h][1] = dp[i - 1][h + 1][0];
                        if (h > 0) {
                            dp[i][h][0] = (dp[i][h][0] + dp[i - 1][h - 1][0]) % MOD;
                            dp[i][h][1] = (dp[i][h][1] + dp[i - 1][h - 1][0]) % MOD;
                        }
                    } else {
                        dp[i][h][0] = (dp[i - 1][h - 1][1] + 1) % MOD;
                        dp[i][h][1] = dp[i - 1][h - 1][0];
                    }
                }
            }
            out.println(dp[n][0][0]);
        }
    }

    static class InputReader {

        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }
    }
}


import java.io.IOException;
import java.util.Scanner;

public class NekoAndAkiPrank {
    private final static long MOD = 1_000_000_007;

    public void solve() throws IOException {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long[][] ways = new long[n * 2][n + 1];
        long tWays = 0;
        ways[0][0] = 1;
        for (int i = 1; i < 2 * n; i++) {
            ways[i][0] = ways[i - 1][1];
            ways[i][n] = ways[i - 1][n - 1];
            for (int k = 1; k < n; k++) {
                ways[i][k] = (ways[i - 1][k - 1] + ways[i - 1][k + 1]) % MOD;
            }
            if (i % 2 == 1) {
                for (int k = 0; k <= Math.min(i, 2 * n - i); k++) {
                    tWays = (tWays + ways[i][k]) % MOD;
                }
            }
        }
        System.out.println(tWays);
    }

    public static void main(String[] args) throws IOException {
        NekoAndAkiPrank solution = new NekoAndAkiPrank();
        solution.solve();
    }
}


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

public class R554D
{

	static long mod = (long)(1e9)+7;
	static long[] fact = new long[3000];
	static int n;
	static long[][][] memo;

    public static void main (String[] args)
    {
        JS scan = new JS();
        n = scan.nextInt();
        memo = new long[2][n+1][n+1];
        for(int i = 0; i < 2; i++){
        	for(int j = 0; j <= n; j++){
        		Arrays.fill(memo[i][j], -1);
        	}
        }
        System.out.println(solve(0, 0, 0)); //DON'T SUBMIT BEFORE YOU MOD
    }

    static long solve(int cant, int i, int j){
    	if(memo[cant][i][j] != -1) return memo[cant][i][j];
    	long resNoTake = 0;
    	if(i < n) resNoTake += solve(0, i+1, j);
    	if(j < i) resNoTake += solve(0, i, j+1);
    	resNoTake %= mod;
    	if(cant == 1) return memo[cant][i][j] = resNoTake;

    	long resTake = 0;
    	long op1 = 0;
    	long op2 = 0;
    	if(i < n){
    		op1 = 1+solve(1, i+1, j);
    		if(j < i){
    			op1 += solve(0, i, j+1);
    		}
    		op1 %= mod;
    	}
    	if(j < i){
    		op2 = 1+solve(1, i, j+1);
    		if(i < n){
    			op2 += solve(0, i+1, j);
    		}
    		op2 %= mod;
    	}
    	resTake = Math.max(op1, op2);

    	return memo[cant][i][j] = Math.max(resTake, resNoTake);
    }

    static long power(long x, long y, long p)
    {
        // Initialize result
    	long res = 1;

        // Update x if it is more than or
        // equal to p
        x = x % p;

        while (y > 0)
        {

            // If y is odd, multiply x
            // with result
            if (y % 2 == 1)
                res = (res * x) % p;

            // y must be even now
            y = y >> 1; // y = y/2
            x = (x * x) % p;
        }
        return res;
    }

    // Returns n^(-1) mod p
    static long modInverse(long n, long p)
    {
        return power(n, p-2, p);
    }

	static void _printParenthesis(char str[], int pos, int n, int open, int close)
    {
        if(close == n)
        {
            // print the possible combinations
            for(int i=0;i<str.length;i++)
                System.out.print(str[i]);
            System.out.println();
            return;
        }
        else
        {
            if(open > close) {
                str[pos] = '}';
                _printParenthesis(str, pos+1, n, open, close+1);
            }
            if(open < n) {
                str[pos] = '{';
                _printParenthesis(str, pos+1, n, open+1, close);
            }
        }
    }

    // Wrapper over _printParenthesis()
    static void printParenthesis(char str[], int n)
    {
        if(n > 0)
        _printParenthesis(str, 0, n, 0, 0);
        return;
    }

	static class JS{
		public int BS = 1<<16;
		public char NC = (char)0;
		byte[] buf = new byte[BS];
		int bId = 0, size = 0;
		char c = NC;
		double num = 1;
		BufferedInputStream in;

		public JS() {
			in = new BufferedInputStream(System.in, BS);
		}

		public JS(String s) throws FileNotFoundException {
			in = new BufferedInputStream(new FileInputStream(new File(s)), BS);
		}

		public char nextChar(){
			while(bId==size) {
				try {
					size = in.read(buf);
				}catch(Exception e) {
					return NC;
				}
				if(size==-1)return NC;
				bId=0;
			}
			return (char)buf[bId++];
		}

		public int nextInt() {
			return (int)nextLong();
		}

		public long nextLong() {
			num=1;
			boolean neg = false;
			if(c==NC)c=nextChar();
			for(;(c<'0' || c>'9'); c = nextChar()) {
				if(c=='-')neg=true;
			}
			long res = 0;
			for(; c>='0' && c <='9'; c=nextChar()) {
				res = (res<<3)+(res<<1)+c-'0';
				num*=10;
			}
			return neg?-res:res;
		}

		public double nextDouble() {
			double cur = nextLong();
			return c!='.' ? cur:cur+nextLong()/num;
		}

		public String next() {
			StringBuilder res = new StringBuilder();
			while(c<=32)c=nextChar();
			while(c>32) {
				res.append(c);
				c=nextChar();
			}
			return res.toString();
		}

		public String nextLine() {
			StringBuilder res = new StringBuilder();
			while(c<=32)c=nextChar();
			while(c!='\n') {
				res.append(c);
				c=nextChar();
			}
			return res.toString();
		}

		public boolean hasNext() {
			if(c>32)return true;
			while(true) {
				c=nextChar();
				if(c==NC)return false;
				else if(c>32)return true;
			}
		}
	}
}


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

public class B {

	static int n,MOD=(int)1e9+7;
	static int [][][]memo;
	static int dp(int balance,int length,int free) {

		int open=balance + (length-balance)/2;
		if(length==2*n)
			return 0;
		if(memo[free][balance][length]!=-1)
			return memo[free][balance][length];
		int ans=0;
		if(open<n) {
			ans += Math.max(dp(balance+1,length+1, 1),dp(balance+1,length+1,free^1)+free);
			if(ans>=MOD)
				ans-=MOD;
		}
		if(balance>0) {
			int x=+open<n?0:free;
			ans += Math.max(dp(balance-1,length+1, 1),dp(balance-1,length+1,x^1)+x);
			if(ans>=MOD)
				ans-=MOD;
		}
		return memo[free][balance][length]=ans;

	}
	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner();
		PrintWriter out = new PrintWriter(System.out);
		n=sc.nextInt();
		memo=new int [2][n+1][2*n+1];
		for(int i=0;i<2;i++)
			for(int j=0;j<=n;j++)
				Arrays.fill(memo[i][j], -1);
		out.println(dp(0,0,1));
		out.close();

	}

	static class Scanner {
		BufferedReader br;
		StringTokenizer st;

		Scanner() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		Scanner(String fileName) throws FileNotFoundException {
			br = new BufferedReader(new FileReader(fileName));
		}

		String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		String nextLine() throws IOException {
			return br.readLine();
		}

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

		long nextLong() throws NumberFormatException, IOException {
			return Long.parseLong(next());
		}

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

	}

}


import java.util.*;
import java.io.*;
import static java.lang.Math.*;
public class Main {
    static final long MOD = 1_000_000_007 , INF = 1_000_000_000_000_000L;
    static final int INf = 1_000_000_000;
    static FastReader reader;
    static PrintWriter writer;
    public static void main(String[] args) {
        Thread t = new Thread(null, new O(), "Integer.MAX_VALUE", 100000000);
        t.start();
    }
    static class O implements Runnable {
        public void run() {
            try {
                magic();
            }
            catch (Exception e) {
                e.printStackTrace();
                System.exit(1);
            }
        }
    }
    static class FastReader {
        final private int BUFFER_SIZE = 1 << 16;
        private DataInputStream din;
        private byte[] buffer;
        private int bufferPointer, bytesRead;

        public FastReader() {
            din = new DataInputStream(System.in);
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public FastReader(String file_name) throws IOException {
            din = new DataInputStream(new FileInputStream(file_name));
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public String readLine() throws IOException {
            byte[] buf = new byte[1000000];
            int cnt = 0, c;
            while ((c = read()) != -1) {
                if (c == '\n') break;
                buf[cnt++] = (byte) c;
            }
            return new String(buf, 0, cnt);
        }

        public int nextInt() throws IOException {
            int ret = 0;
            byte c = read();
            while (c <= ' ') c = read();
            boolean neg = (c == '-');
            if (neg) c = read();
            do {
                ret = ret * 10 + c - '0';
            } while ((c = read()) >= '0' && c <= '9');
            if (neg) return -ret;
            return ret;
        }

        public long nextLong() throws IOException {
            long ret = 0;
            byte c = read();
            while (c <= ' ') c = read();
            boolean neg = (c == '-');
            if (neg) c = read();
            do {
                ret = ret * 10 + c - '0';
            } while ((c = read()) >= '0' && c <= '9');
            if (neg) return -ret;
            return ret;
        }

        public double nextDouble() throws IOException {
            double ret = 0, div = 1;
            byte c = read();
            while (c <= ' ') c = read();
            boolean neg = (c == '-');
            if (neg) c = read();
            do {
                ret = ret * 10 + c - '0';
            } while ((c = read()) >= '0' && c <= '9');
            if (c == '.') while ((c = read()) >= '0' && c <= '9') ret += (c - '0') / (div *= 10);
            if (neg) return -ret;
            return ret;
        }

        private void fillBuffer() throws IOException {
            bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
            if (bytesRead == -1) buffer[0] = -1;
        }

        private byte read() throws IOException {
            if (bufferPointer == bytesRead) fillBuffer();
            return buffer[bufferPointer++];
        }

        public void close() throws IOException {
            if (din == null) return;
            din.close();
        }
    }
    static int n;
    static Pair dp[][];
    static void magic() throws IOException {
        reader = new FastReader();
        writer = new PrintWriter(System.out, true);
        n = reader.nextInt();
        dp = new Pair[2 * n + 1][2 * n + 1];
        writer.println(f(0,0).ans);

    }
    static Pair f(int idx, int open_count) {
        if(idx==2*n) {
            if(open_count==0) {
                return new Pair(0, true);
            }
            else {
                return new Pair(0, false);
            }
        }
        if(dp[idx][open_count]!=null) {
            return dp[idx][open_count];
        }
        Pair left = new Pair(0, false);
        int udhar = 2*n - idx - 1;
        if(udhar>open_count) {
            left = f(idx+1, open_count+1);
        }
        Pair right = open_count>0 ? f(idx+1, open_count-1) : new Pair(0, false);
        if(left.free || right.free) {
            return dp[idx][open_count] = new Pair((int)((left.ans+right.ans+1)%MOD), false);
        }
        else {
            return dp[idx][open_count] = new Pair((int)((left.ans+right.ans)%MOD), true);
        }
    }
    static class Pair {
        int ans;
        boolean free;
        Pair(int ans, boolean free) {
            this.ans = ans;
            this.free = free;
        }
    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Rustam Musin (t.me/musin_acm)
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        DNekoIPrank solver = new DNekoIPrank();
        solver.solve(1, in, out);
        out.close();
    }

    static class DNekoIPrank {
        int mod = (int) 1e9 + 7;

        public void solve(int testNumber, InputReader in, OutputWriter out) {
            int n = in.readInt();
            int ans = new Solve().solve(n);
            out.print(ans);
        }

        class Solve {
            int solve(int n) {
                int[][][] dp = new int[2 * n + 1][2 * n + 1][2];
                dp[0][0][0] = 1;
                for (int depth = 1; depth <= 2 * n; depth++) {
                    for (int opened = depth & 1; opened <= depth; opened += 2) {
                        if (opened - 1 >= 0) {
                            dp[depth][opened][0] += dp[depth - 1][opened - 1][1];
                            dp[depth][opened][1] += dp[depth - 1][opened - 1][0];
                        }
                        if (opened + 1 <= n) {
                            dp[depth][opened][0] += dp[depth - 1][opened + 1][1];
                            dp[depth][opened][1] += dp[depth - 1][opened + 1][0];
                        }
                        dp[depth][opened][0]++;
                        dp[depth][opened][0] %= mod;
                        dp[depth][opened][1] %= mod;
                    }
                }
                return dp[2 * n][0][1];
            }

        }

    }

    static 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 close() {
            writer.close();
        }

        public void print(int i) {
            writer.print(i);
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.SpaceCharFilter filter;

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

        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 readInt() {
            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 boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

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

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }
}


import java.lang.*;
import java.math.*;
import java.util.*;
import java.io.*;
public class Main {
    void solve() {
        n=ni();
        dp=new int[2*n+1][n+1][2];
        for(int i=1;i<=2*n;i++) for(int j=0;j<=n;j++) Arrays.fill(dp[i][j],-1);
        int ans=go(1,0,0);
        pw.println(ans);
    }
    int dp[][][];
    int n;
    int go(int i,int j,int taken){
        if(j<0 || j>n) return Integer.MIN_VALUE;
        if(i>2*n){
            if(j==0) return 0;
            return Integer.MIN_VALUE;
        }
     //   pw.println(i+" "+j+" "+dp[i][j][taken]);
        if(dp[i][j][taken]!=-1) return dp[i][j][taken];

        int cc=Integer.MIN_VALUE,d1=-1,d2=-1;

            d1=go(i+1,j+1,0);
            d2=go(i+1,j-1,0);
            if(d1==Integer.MIN_VALUE && d2==Integer.MIN_VALUE){

            }else {
                d1=Math.max(0,d1);
                d2=Math.max(0,d2);
                cc=add(d1,d2);
            }
            if(taken==0){
            d1=go(i+1,j+1,1);
            d2=go(i+1,j-1,1);
            if(d1==Integer.MIN_VALUE && d2==Integer.MIN_VALUE){

            }else {
                d1=Math.max(0,d1);
                d2=Math.max(0,d2);
                cc=Math.max(cc,add(1,add(d1,d2)));
            }

        }
        dp[i][j][taken]=cc;
        return cc;
    }

    int add(long a,long b){
        a+=b;
        if(a>=M)a-=M;
        return (int)a;
    }

    long M =(long)1e9+7;
    InputStream is;
    PrintWriter pw;
    String INPUT = "";

    void run() throws Exception {
        is = INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes());
        pw = new PrintWriter(System.out);
        long s = System.currentTimeMillis();
        solve();
        pw.flush();
        if (!INPUT.isEmpty()) tr(System.currentTimeMillis() - s + "ms");

    }

    public static void main(String[] args) throws Exception {
        new Main().run();
    }

    private byte[] inbuf = new byte[1024];
    public int lenbuf = 0, ptrbuf = 0;

    private int readByte() {
        if (lenbuf == -1) throw new InputMismatchException();
        if (ptrbuf >= lenbuf) {
            ptrbuf = 0;
            try {
                lenbuf = is.read(inbuf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (lenbuf <= 0) return -1;
        }
        return inbuf[ptrbuf++];
    }

    private boolean isSpaceChar(int c) {
        return !(c >= 33 && c <= 126);
    }

    private int skip() {
        int b;
        while ((b = readByte()) != -1 && isSpaceChar(b)) ;
        return b;
    }

    private double nd() {
        return Double.parseDouble(ns());
    }

    private char nc() {
        return (char) skip();
    }

    private String ns() {
        int b = skip();
        StringBuilder sb = new StringBuilder();
        while (!(isSpaceChar(b))) { // when nextLine, (isSpaceChar(b) && b != ' ')
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }

    private char[] ns(int n) {
        char[] buf = new char[n];
        int b = skip(), p = 0;
        while (p < n && !(isSpaceChar(b))) {
            buf[p++] = (char) b;
            b = readByte();
        }
        return n == p ? buf : Arrays.copyOf(buf, p);
    }

    private char[][] nm(int n, int m) {
        char[][] map = new char[n][];
        for (int i = 0; i < n; i++) map[i] = ns(m);
        return map;
    }

    private int[] na(int n) {
        int[] a = new int[n];
        for (int i = 0; i < n; i++) a[i] = ni();
        return a;
    }

    private int ni() {
        int num = 0, b;
        boolean minus = false;
        while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;
        if (b == '-') {
            minus = true;
            b = readByte();
        }

        while (true) {
            if (b >= '0' && b <= '9') {
                num = num * 10 + (b - '0');
            } else {
                return minus ? -num : num;
            }
            b = readByte();
        }
    }

    private long nl() {
        long num = 0;
        int b;
        boolean minus = false;
        while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;
        if (b == '-') {
            minus = true;
            b = readByte();
        }

        while (true) {
            if (b >= '0' && b <= '9') {
                num = num * 10 + (b - '0');
            } else {
                return minus ? -num : num;
            }
            b = readByte();
        }
    }

    private boolean oj = System.getProperty("ONLINE_JUDGE") != null;

    private void tr(Object... o) {
        if (INPUT.length() > 0) System.out.println(Arrays.deepToString(o));
    }

}


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

public class Main {
	public static void main(String args[]) {new Main().run();}

	FastReader in = new FastReader();
	PrintWriter out = new PrintWriter(System.out);
	void run(){
		work();
		out.flush();
	}
	long mod=1000000007;
	long gcd(long a,long b) {
		return a==0?b:b>a?gcd(b%a,a):gcd(b,a);
	}
	void work() {
		int n=in.nextInt();
		long[] dp=new long[2*n+1];
		long ret=0;
		dp[0]=1;
		for(int p=1;p<=2*n;p++) {
			long[] ndp=new long[2*n+1];
			for(int i=0;i<2*n;i++) {
				ndp[i+1]+=dp[i];
				ndp[i+1]%=mod;
				if(i-1>=0) {
					ndp[i-1]+=dp[i];
					ndp[i-1]%=mod;
					if(p%2==0) {
						int r=2*n-p;
						if(r>=i-1) {
							ret+=dp[i];
						}
					}
				}
			}
			ret%=mod;
			dp=ndp;
		}
		out.println(ret);
	}
}

class FastReader
{
	BufferedReader br;
	StringTokenizer st;

	public FastReader()
	{
		br=new BufferedReader(new InputStreamReader(System.in));
	}

	public String next()
	{
		if(st==null || !st.hasMoreElements())
		{
			try {
				st = new StringTokenizer(br.readLine());
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
		return st.nextToken();
	}

	public int nextInt()
	{
		return Integer.parseInt(next());
	}

	public long nextLong()
	{
		return Long.parseLong(next());
	}
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Rustam Musin (t.me/musin_acm)
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        DNekoIPrank solver = new DNekoIPrank();
        solver.solve(1, in, out);
        out.close();
    }

    static class DNekoIPrank {
        int mod = (int) 1e9 + 7;

        public void solve(int testNumber, InputReader in, OutputWriter out) {
            int n = in.readInt();
            int ans = new Solve().solve(n);
            out.print(ans);
        }

        class Solve {
            int solve(int n) {
                int[][][] dp = new int[2 * n + 1][2 * n + 1][2];
                dp[0][0][0] = 1;
                for (int depth = 1; depth <= 2 * n; depth++) {
                    for (int opened = depth & 1; opened <= depth; opened += 2) {
                        if (opened - 1 >= 0) {
                            dp[depth][opened][0] += dp[depth - 1][opened - 1][1];
                            dp[depth][opened][1] += dp[depth - 1][opened - 1][0];
                        }
                        if (opened + 1 < dp[depth - 1].length) {
                            dp[depth][opened][0] += dp[depth - 1][opened + 1][1];
                            dp[depth][opened][1] += dp[depth - 1][opened + 1][0];
                        }
                        dp[depth][opened][0]++;
                        dp[depth][opened][0] %= mod;
                        dp[depth][opened][1] %= mod;
                    }
                }
                return dp[2 * n][0][1];
            }

        }

    }

    static 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 close() {
            writer.close();
        }

        public void print(int i) {
            writer.print(i);
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.SpaceCharFilter filter;

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

        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 readInt() {
            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 boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

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

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }
}


import java.util.Scanner;

public class Main {
    private static Scanner sc = new Scanner(System.in);
    private static int mod = 1000000007;
    public static void main(String[] args) {
        int [][]dp = new int[2005][22005];
        int [][]ok = new int[2005][2005];
        ok[0][0] = 1;
        for(int i = 1; i <= 2000; i++){
            for(int j = i & 1; j <= i; j += 2){
                if(j == 0) {
                    dp[i][j] = dp[i - 1][j + 1];
                    if(ok[i - 1][j + 1] == 1)
                        dp[i][j] = (dp[i][j] + 1) % mod;
                    else
                        ok[i][j] = 1;
                    continue;
                }
                dp[i][j] = (dp[i - 1][j - 1] + dp[i - 1][j + 1]) % mod;
                if(ok[i - 1][j + 1] == 1 || ok[i - 1][j - 1] == 1)
                    dp[i][j] = (dp[i][j] + 1) % mod;
                else
                    ok[i][j] = 1;

            }
        }
        System.out.print(dp[2 * sc.nextInt()][0]);
    }

}


import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;

import static java.lang.Math.max;

public class D {
    static int n;
    static long dp[][][], mod = (long) 1e9 + 7, inf = (long) 1e18;

    public static void main(String[] args) throws Exception {
        Scanner in = new Scanner(System.in);
        PrintWriter pw = new PrintWriter(System.out);
        n = in.nextInt();
        dp = new long[2][n + n + 1][n + n + 1];
        for (long a[][] : dp) for (long b[] : a) Arrays.fill(b, -1);
        pw.println(solve(0, 0, 0));
        pw.close();
    }

    static long solve(int last, int pos, int sum) {
        if (pos >= n + n) {
            if (sum == 0) return 0;
            return -inf;
        }
        if (dp[last][pos][sum] != -1) return dp[last][pos][sum];
        long ans = 0, a = 0, b = 0, rem = n + n - pos;
        if (rem >= sum + 1) a = max(0, solve(0, pos + 1, sum + 1));
        if (sum - 1 >= 0) b = max(0, solve(0, pos + 1, sum - 1));
        ans = max(ans, a + b);
        if (last == 0) {
            a = 0;
            b = 0;
            if (rem >= sum + 1) a = max(0, solve(1, pos + 1, sum + 1));
            if (sum - 1 >= 0) b = max(0, solve(1, pos + 1, sum - 1));
            ans = max(ans, 1 + a + b);
        }
        if (ans >= 0) ans %= mod;
        return dp[last][pos][sum] = ans;
    }

    static void debug(Object... obj) {
        System.err.println(Arrays.deepToString(obj));
    }
}


import java.util.Scanner;

public class Main {
    static long dp[] = new long[1010];
    static int mod = (int)1e9 + 7;
    static long add(long x, long y){
        long tmp = x + y;
        return tmp >= mod ? tmp - mod : tmp;
    }
    public static void main(String args[]){
        Scanner cin = new Scanner(System.in);
        int n = cin.nextInt();
        dp[0] = 1;
        long ans = 0;
        for(int i = 0; i <= n; i++){
            for(int j = i; j <= n; j++){
                if((i + j) % 2 == 1){
                    ans = add(ans, dp[j]);
                }
                dp[j + 1] = add(dp[j + 1], dp[j]);
            }
        }
        System.out.println(ans);
    }
}


// Change Of Plans BABY.... Change Of Plans //
import java.io.*;
import java.util.*;
import static java.lang.Math.*;

public class nekoAndAkkiPrank {

    static void MainSolution() {
        //constructing tree upside down
        n=2*ni();
        long dp[][]=new long[n+1][n+1];
        boolean free[][]=new boolean[n+1][n+1];
        free[0][0]=true;  // selecting the first edge

        for(int i=1;i<=n;i++){
            for(int j=0;j<=n;j++){
                long l=j-1>=0?dp[i-1][j-1]:0;
                long r=i-1>=j+1?dp[i-1][j+1]:0;

                boolean free_l=j-1>=0?free[i-1][j-1]:false;
                boolean free_r=i-1>=j+1?free[i-1][j+1]:false;

                if(free_l || free_r){
                    dp[i][j]=(l+r+1)%mod9;
                }
                else{
                    dp[i][j] = (l+r)%mod9;
                    free[i][j]=true;
                }
            }
        }
        pl(dp[n][0]);
    }
    /*----------------------------------------------------------------------------------------------------------------*/
    //THE DON'T CARE ZONE BEGINS HERE...\\
    static int mod9 = 1000000007;
    static int n, m, l, k, t, mod = 998244353;
    static AwesomeInput input = new AwesomeInput(System.in);
    static PrintWriter pw = new PrintWriter(System.out, true);

    static class AwesomeInput {
        private InputStream letsDoIT;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private SpaceCharFilter filter;

        private AwesomeInput(InputStream incoming) {
            this.letsDoIT = incoming;
        }

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

        private long ForLong() {
            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;
        }

        private String ForString() {
            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 c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            boolean isSpaceChar(int ch);
        }
    }

    // functions to take input//
    static int ni() {
        return (int) input.ForLong();
    }

    static String ns() {
        return input.ForString();
    }

    static long nl() {
        return input.ForLong();
    }

    static double nd() throws IOException {
        return Double.parseDouble(new BufferedReader(new InputStreamReader(System.in)).readLine());
    }

    //functions to give output
    static void pl() {
        pw.println();
    }

    static void p(Object o) {
        pw.print(o + " ");
    }

    static void pws(Object o) {
        pw.print(o + "");
    }

    static void pl(Object o) {
        pw.println(o);
    }

    public static int[] fastSort(int[] f) {
        int n = f.length;
        int[] to = new int[n];
        {
            int[] b = new int[65537];
            for (int i = 0; i < n; i++) b[1 + (f[i] & 0xffff)]++;
            for (int i = 1; i <= 65536; i++) b[i] += b[i - 1];
            for (int i = 0; i < n; i++) to[b[f[i] & 0xffff]++] = f[i];
            int[] d = f;
            f = to;
            to = d;
        }
        {
            int[] b = new int[65537];
            for (int i = 0; i < n; i++) b[1 + (f[i] >>> 16)]++;
            for (int i = 1; i <= 65536; i++) b[i] += b[i - 1];
            for (int i = 0; i < n; i++) to[b[f[i] >>> 16]++] = f[i];
            int[] d = f;
            f = to;
            to = d;
        }
        return f;
    }

    public static void main(String[] args) {      //threading has been used to increase the stack size.

        new Thread(null, null, "Vengeance", 1 << 25)  //the last parameter is stack size desired.
        {
            public void run() {
                try {
                    double s = System.currentTimeMillis();
                    MainSolution();
                    //pl(("\nExecution Time : " + ((double) System.currentTimeMillis() - s) / 1000) + " s");
                    pw.flush();
                    pw.close();
                } catch (Exception e) {
                    e.printStackTrace();
                    System.exit(1);
                }
            }
        }.start();
    }
}


import java.io.*;
import java.nio.CharBuffer;
import java.util.NoSuchElementException;

public class P1152D {

    public static void main(String[] args) {
        SimpleScanner scanner = new SimpleScanner(System.in);
        PrintWriter writer = new PrintWriter(System.out);

        final int MODULO = 1000000007;
        int n = scanner.nextInt();
        int m = 2 * n;
        int[][] f = new int[m + 1][m + 2];
        f[0][0] = 1;
        int ans = 0;
        for (int i = 1; i <= m; ++i) {
            f[i][0] = f[i - 1][1];
            for (int j = 1; j <= m; ++j) {
                f[i][j] = (f[i - 1][j - 1] + f[i - 1][j + 1]) % MODULO;
            }
            if (i % 2 == 1) {
                for (int j = 1; i + j <= m; j += 2)
                    ans = (ans + f[i][j]) % MODULO;
            }
        }
        writer.println(ans);

        writer.close();
    }

    private static class SimpleScanner {

        private static final int BUFFER_SIZE = 10240;

        private Readable in;
        private CharBuffer buffer;
        private boolean eof;

        SimpleScanner(InputStream in) {
            this.in = new BufferedReader(new InputStreamReader(in));
            buffer = CharBuffer.allocate(BUFFER_SIZE);
            buffer.limit(0);
            eof = false;
        }

        private char read() {
            if (!buffer.hasRemaining()) {
                buffer.clear();
                int n;
                try {
                    n = in.read(buffer);
                } catch (IOException e) {
                    n = -1;
                }
                if (n <= 0) {
                    eof = true;
                    return '\0';
                }
                buffer.flip();
            }
            return buffer.get();
        }

        void checkEof() {
            if (eof)
                throw new NoSuchElementException();
        }

        char nextChar() {
            checkEof();
            char b = read();
            checkEof();
            return b;
        }

        String next() {
            char b;
            do {
                b = read();
                checkEof();
            } while (Character.isWhitespace(b));
            StringBuilder sb = new StringBuilder();
            do {
                sb.append(b);
                b = read();
            } while (!eof && !Character.isWhitespace(b));
            return sb.toString();
        }

        int nextInt() {
            return Integer.valueOf(next());
        }

        long nextLong() {
            return Long.valueOf(next());
        }

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


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

public class Task {

    public static void main(String[] args) throws IOException {

        new Task().go();
    }

    PrintWriter out;
    Reader in;
    BufferedReader br;

    Task() throws IOException {

        try {

            //br = new BufferedReader( new FileReader("input.txt") );
            in = new Reader("input.txt");
            out = new PrintWriter( new BufferedWriter(new FileWriter("output.txt")) );
        }
        catch (Exception e) {

            //br = new BufferedReader( new InputStreamReader( System.in ) );
            in = new Reader();
            out = new PrintWriter( new BufferedWriter(new OutputStreamWriter(System.out)) );
        }
    }

    void go() throws IOException {

        int t = 1;
        while (t > 0) {
            solve();
            //out.println();
            t--;
        }

        out.flush();
        out.close();
    }

    int inf = 2000000000;
    int mod = 1000000007;
    double eps = 0.000000001;

    int n;
    int m;
    ArrayList<Integer>[] g;
    void solve() throws IOException {

        int n = in.nextInt();
        int[][] dp = new int[n * 2][n + 1];
        dp[0][1] = 1;
        for (int i = 1; i < n * 2; i++)
            for (int j = 0; j <= n; j++) {
                if (j + 1 <= n) {
                    dp[i][j + 1] += dp[i - 1][j];
                    dp[i][j + 1] %= mod;
                }

                if (j - 1 >= 0) {
                    dp[i][j - 1] += dp[i - 1][j];
                    dp[i][j - 1] %= mod;
                }
            }

        //System.err.println(dp[2 * n - 1][0]);

        int ans = 0;
        for (int i = 2 * n - 2; i >= 0; i -= 2)
            for (int j = 0; j <= n; j++)
                if (j <= 2 * n - 1 - i && j % 2 == 1) {
                    ans = (ans + dp[i][j]) % mod;
                    //System.err.println(i +" " + j + " " + ans);
                }

        out.print(ans);
    }

    class Pair implements Comparable<Pair> {
        int a;
        int b;

        Pair(int a, int b) {
            this.a = a;
            this.b = b;
        }

        public int compareTo(Pair p) {
            if (a != p.a)
                return Integer.compare(a, p.a);
            else
                return Integer.compare(b, p.b);
        }
    }

    class Item {

        int a;
        int b;
        int c;

        Item(int a, int b, int c) {
            this.a = a;
            this.b = b;
            this.c = c;
        }

    }

    class Reader {

        BufferedReader  br;
        StringTokenizer tok;

        Reader(String file) throws IOException {
            br = new BufferedReader( new FileReader(file) );
        }

        Reader() throws IOException {
            br = new BufferedReader( new InputStreamReader(System.in) );
        }

        String next() throws IOException {

            while (tok == null || !tok.hasMoreElements())
                tok = new StringTokenizer(br.readLine());
            return tok.nextToken();
        }

        int nextInt() throws NumberFormatException, IOException {
            return Integer.valueOf(next());
        }

        long nextLong() throws NumberFormatException, IOException {
            return Long.valueOf(next());
        }

        double nextDouble() throws NumberFormatException, IOException {
            return Double.valueOf(next());
        }

        String nextLine() throws IOException {
            return br.readLine();
        }

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

        ArrayList<Integer>[] nextGraph(int n, int m) throws IOException {
            ArrayList<Integer>[] g = new ArrayList[n];
            for (int i = 0; i < n; i++)
                g[i] = new ArrayList<>();
            for (int i = 0; i < m; i++) {
                int x = nextInt() - 1;
                int y = nextInt() - 1;
                g[x].add(y);
                g[y].add(x);
            }

            return g;
        }

    }

}


import java.util.*;

import java.io.*;

public class temppp {

	public static void main(String[] args) {

		// TODO Auto-generated method stub

		FastInputReader s = new FastInputReader();
		int n = s.nextInt();
		String str = s.nextLine();
		for(int i=2;i<=n;i++) {
			if(n%i==0) {
				StringBuilder ss = new StringBuilder(str.substring(0,i));
				ss.reverse().toString();
				str=ss.toString()+str.substring(i);

			}
		}
		System.out.println(str);

	}

	public static class FastInputReader {

		private byte[] buf = new byte[16384];

		private int curChar;

		private int numChars;

		public int read() {

			if (numChars == -1)

				throw new InputMismatchException();

			if (curChar >= numChars) {

				curChar = 0;

				try {

					numChars = System.in.read(buf);

				} catch (IOException e) {

					throw new InputMismatchException();

				}

				if (numChars <= 0)

					return -1;

			}

			return buf[curChar++];

		}

		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 String nextString() {

			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 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 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 int[] nextIntArray(int n) {

			int[] arr = new int[n];

			for (int i = 0; i < n; i++) {

				arr[i] = nextInt();

			}

			return arr;

		}

		public long[] nextLongArray(int n) {

			long[] arr = new long[n];

			for (int i = 0; i < n; i++) {

				arr[i] = nextLong();

			}

			return arr;

		}

		private 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;

		}

	}

	public static class MyScanner {

		BufferedReader reader;

		public MyScanner() {

			this.reader = new BufferedReader(new InputStreamReader(System.in));

		}

		public void close() throws IOException {

			this.reader.close();

		}

		int nextInt() {

			return Integer.parseInt(this.next());

		}

		long nextLong() {

			return Long.parseLong(this.next());

		}

		float nextFloat() {

			return Float.parseFloat(this.next());

		}

		double nextDouble() {

			return Double.parseDouble(this.next());

		}

		String next() {

			String str = "";

			try {

				str = this.reader.readLine().trim();

			} catch (IOException e) {

				e.printStackTrace();

			}

			return str;

		}

		String[] nextStringArray() {

			String[] str = null;

			try {

				str = this.reader.readLine().trim().split(" ");

			} catch (IOException e) {

				e.printStackTrace();

			}

			return str;

		}

		int[] nextIntArray() {

			String[] data = nextStringArray();

			int[] a = new int[data.length];

			for (int i = 0; i < a.length; i++) {

				a[i] = Integer.parseInt(data[i]);

			}

			return a;

		}

		Integer[] nextIntegerArray() {

			String[] data = nextStringArray();

			Integer[] a = new Integer[data.length];

			for (int i = 0; i < a.length; i++) {

				a[i] = Integer.parseInt(data[i]);

			}

			return a;

		}

		long[] nextLongArray() {

			String[] data = nextStringArray();

			long[] a = new long[data.length];

			for (int i = 0; i < a.length; i++) {

				a[i] = Long.parseLong(data[i]);

			}

			return a;

		}

		float[] nextFloatArray() {

			String[] data = nextStringArray();

			float[] a = new float[data.length];

			for (int i = 0; i < a.length; i++) {

				a[i] = Float.parseFloat(data[i]);

			}

			return a;

		}

		double[] nextDoubleArray() {

			String[] data = nextStringArray();

			double[] a = new double[data.length];

			for (int i = 0; i < a.length; i++) {

				a[i] = Double.parseDouble(data[i]);

			}

			return a;

		}

	}

}


import java.util.*;

public class Main
{

	public static void main(String[] args)
	{

		Scanner sc = new Scanner(System.in);
		long l = sc.nextInt();
		long r = sc.nextInt();
		long x = sc.nextInt();
		long y = sc.nextInt();

		long k = sc.nextInt();

		long min = k*y - l;
		long max = r - k*x;

		if(min>=0 && max>=0)
		{
			boolean check = false;

			for(long i=x;i<=y && k*i<=r && !check;i++)
			{
				if(k*i<=r && k*i>=l)
					check = true;
			}

			if(check)
				System.out.println("YES");
			else
				System.out.println("NO");
		}
		else
			System.out.println("NO");
	}
}


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

public class C {

	BufferedReader br;
	PrintWriter out;
	StringTokenizer st;
	boolean eof;

	int n, m;

	class Edge {
		int to, flow, cap, cost;
		Edge rev;

		public Edge(int to, int cap, int cost) {
			this.to = to;
			this.cap = cap;
			this.cost = cost;
		}
	}

	static final int[] dx = { -1, 0, 1, 0 };
	static final int[] dy = { 0, -1, 0, 1 };
	static final int INF = Integer.MAX_VALUE / 3;

	List<Edge>[] g;

	void addEdge(int v1, int v2, int cost) {
		Edge e1 = new Edge(v2, 1, cost);
		Edge e2 = new Edge(v1, 0, -cost);
		e1.rev = e2;
		e2.rev = e1;
		g[v1].add(e1);
		g[v2].add(e2);
	}

	int S, T;

	void solve() throws IOException {
		n = nextInt();
		m = nextInt();

		int[][] f = new int[n][m];
		for (int i = 0; i < n; i++)
			for (int j = 0; j < m; j++)
				f[i][j] = nextInt();

		g = new ArrayList[n * m + 2];
		S = n * m;
		T = n * m + 1;
		for (int i = 0; i < n * m; i++)
			g[i] = new ArrayList<>(5);
		g[S] = new ArrayList<>(n * m / 2);
		g[T] = new ArrayList<>(n * m / 2);

		for (int i = 0; i < n; i++)
			for (int j = 0; j < m; j++) {
				int v = i * m + j;
				int col = (i + j) & 1;
				if (col == 0) {
					addEdge(S, v, 0);
					for (int dir = 0; dir < 4; dir++) {
						int ni = i + dx[dir];
						int nj = j + dy[dir];
						if (ni >= 0 && ni < n && nj >= 0 && nj < m) {
							int to = ni * m + nj;
							int cost = (f[i][j] == f[ni][nj] ? 0 : 1);
							addEdge(v, to, cost);
						}
					}
				} else {
					addEdge(v, T, 0);
				}
			}

		int ans = 0;
		int[] pi = new int[n * m + 2];

		final int[] d = new int[n * m + 2];
		Edge[] from = new Edge[n * m + 2];

		Integer[] Integers = new Integer[n * m + 2];
		for (int i = 0; i < n * m + 2; i++)
			Integers[i] = i;

		TreeSet<Integer> set = new TreeSet<>(new Comparator<Integer>() {

			@Override
			public int compare(Integer o1, Integer o2) {
				if (d[o1] != d[o2])
					return Integer.compare(d[o1], d[o2]);
				return o1.compareTo(o2);
			}

		});

		for (int iter = 0; iter < n * m / 2; iter++) {

			Arrays.fill(d, INF);
			d[S] = 0;

			set.add(Integers[S]);

			while (!set.isEmpty()) {
				int v = set.pollFirst();

				for (int i = 0; i < g[v].size(); i++) {
					Edge e = g[v].get(i);
					if (e.flow < e.cap) {
						int redCost = e.cost - pi[v] + pi[e.to];
						if (redCost < 0)
							throw new AssertionError();
						if (d[e.to] > d[v] + redCost) {
							set.remove(Integers[e.to]);
							from[e.to] = e;
							d[e.to] = d[v] + redCost;
							set.add(Integers[e.to]);
						}
					}
				}
			}

			for (int i = 0; i < n * m + 2; i++) {
				pi[i] -= d[i];
			}

			for (int v = T; v != S; ) {
				Edge last = from[v];
				last.flow++;
				last.rev.flow--;
				ans += last.cost;
				v = last.rev.to;
			}

		}

		out.println(ans);

	}

	C() 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 C();
	}

	String nextToken() {
		while (st == null || !st.hasMoreTokens()) {
			try {
				st = new StringTokenizer(br.readLine());
			} catch (Exception e) {
				eof = true;
				return null;
			}
		}
		return st.nextToken();
	}

	String nextString() {
		try {
			return br.readLine();
		} catch (IOException e) {
			eof = true;
			return null;
		}
	}

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

	long nextLong() throws IOException {
		return Long.parseLong(nextToken());
	}

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


import java.util.Comparator;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.Writer;
import java.util.List;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.InputMismatchException;
import java.util.ArrayList;
import java.util.ArrayDeque;
import java.io.Reader;
import java.util.TreeSet;
import java.util.Collections;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author Niyaz Nigmatullin
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		FastScanner in = new FastScanner(inputStream);
		FastPrinter out = new FastPrinter(outputStream);
		TaskC2 solver = new TaskC2();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskC2 {

    final int[] DX = {1, 0, -1, 0};
    final int[] DY = {0, 1, 0, -1};

    public void solve(int testNumber, FastScanner in, FastPrinter out) {
        int n = in.nextInt();
        int m = in.nextInt();
        int[][] a = new int[n][];
        for (int i = 0; i < n; i++) {
            a[i] = in.readIntArray(m);
        }
        boolean[][] has = new boolean[n][m];
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                for (int dir = 0; dir < 4; dir++) {
                    int x = i + DX[dir];
                    int y = j + DY[dir];
                    if (x < 0 || y < 0 || x >= n || y >= m || a[x][y] != a[i][j]) continue;
                    has[i][j] = true;
                }
            }
        }
        MinCostMaxFlowGraph g = new MinCostMaxFlowGraph(n * m + 2);
        int source = n * m;
        int target = n * m + 1;
        int ans = 0;
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                if (has[i][j]) {
                    continue;
                }
                if ((i + j & 1) == 1) {
                    g.addEdge(i * m + j, target, 0, 1, 0);
                    continue;
                }
                g.addEdge(source, i * m + j, 0, 1, 0);
                ans++;
                ArrayDeque<Integer> q = new ArrayDeque<>();
                int[][] d = new int[n][m];
                for (int[] e : d) {
                    Arrays.fill(e, Integer.MAX_VALUE);
                }
                d[i][j] = 0;
                q.add(i * m + j);
                while (!q.isEmpty()) {
                    int v = q.pollFirst();
                    int cx = v / m;
                    int cy = v % m;
                    for (int dir = 0; dir < 4; dir++) {
                        int x = cx + DX[dir];
                        int y = cy + DY[dir];
                        if (x < 0 || y < 0 || x >= n || y >= m) continue;
                        int cost = 1;
                        if (a[x][y] == a[cx][cy]) cost = 0;
                        if (d[x][y] > d[cx][cy] + cost) {
                            q.addLast(x * m + y);
                            d[x][y] = d[cx][cy] + cost;
                        }
                    }
                }
                for (int x = 0; x < n; x++) {
                    for (int y = 0; y < m; y++) {
                        if ((x + y & 1) == 0) continue;
                        if (has[x][y]) continue;
                        g.addEdge(i * m + j, x * m + y, 0, 1, d[x][y] - 1);
                    }
                }
            }
        }
//        System.out.println(ans);
        ans += g.getMinCostMaxFlow(source, target)[1];
        out.println(ans);
    }

    }

class FastScanner extends BufferedReader {

    public FastScanner(InputStream is) {
        super(new InputStreamReader(is));
    }

    public int read() {
        try {
            int ret = super.read();
//            if (isEOF && ret < 0) {
//                throw new InputMismatchException();
//            }
//            isEOF = ret == -1;
            return ret;
        } catch (IOException e) {
            throw new InputMismatchException();
        }
    }

    static boolean isWhiteSpace(int c) {
        return c >= 0 && c <= 32;
    }

    public int nextInt() {
        int c = read();
        while (isWhiteSpace(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int ret = 0;
        while (c >= 0 && !isWhiteSpace(c)) {
            if (c < '0' || c > '9') {
                throw new NumberFormatException("digit expected " + (char) c
                        + " found");
            }
            ret = ret * 10 + c - '0';
            c = read();
        }
        return ret * sgn;
    }

    public String readLine() {
        try {
            return super.readLine();
        } catch (IOException e) {
            return null;
        }
    }

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

    }

class FastPrinter extends PrintWriter {

    public FastPrinter(OutputStream out) {
        super(out);
    }

    public FastPrinter(Writer out) {
        super(out);
    }

}

class MinCostMaxFlowGraph {
    public static class Edge {
        int from;
        int to;
        public int flow;
        int cap;
        long cost;
        Edge rev;

        public Edge(int from, int to, int flow, int cap, long cost) {
            this.from = from;
            this.to = to;
            this.flow = flow;
            this.cap = cap;
            this.cost = cost;
        }

        public String toString() {
            return "Edge [from=" + from + ", to=" + to + ", flow=" + flow
                    + ", cap=" + cap + ", cost=" + cost + "]";
        }

    }

    int n;
    ArrayList<Edge>[] edges;

    public MinCostMaxFlowGraph(int n) {
        this.n = n;
        edges = new ArrayList[n];
        for (int i = 0; i < edges.length; i++) {
            edges[i] = new ArrayList<Edge>();
        }
    }

    public Edge addEdge(int from, int to, int flow, int cap, long cost) {
        Edge e1 = new Edge(from, to, flow, cap, cost);
        Edge e2 = new Edge(to, from, flow, 0, -cost);
        e1.rev = e2;
        e2.rev = e1;
        edges[from].add(e1);
        edges[to].add(e2);
        return e1;
    }

    public long[] getMinCostMaxFlow(int source, int target) {
        long[] h = new long[n];
        for (boolean changed = true; changed; ) {
            changed = false;
            for (int i = 0; i < n; i++) {
                for (Edge e : edges[i]) {
                    if (e.cap > 0 && h[e.to] > h[e.from] + e.cost) {
                        h[e.to] = h[e.from] + e.cost;
                        changed = true;
                    }
                }
            }
        }
        Edge[] lastEdge = new Edge[n];
        long[] d = new long[n];
        int flow = 0;
        long cost = 0;
        while (true) {
            dijkstra(source, lastEdge, d, h);
            if (d[target] == Long.MAX_VALUE) {
                break;
            }
            int addFlow = Integer.MAX_VALUE;
            for (int v = target; v != source; ) {
                Edge e = lastEdge[v];
                addFlow = Math.min(addFlow, e.cap - e.flow);
                v = e.from;
            }
            cost += (d[target] + h[target] - h[source]) * addFlow;
            flow += addFlow;
            for (int v = target; v != source; ) {
                Edge e = lastEdge[v];
                e.flow += addFlow;
                e.rev.flow -= addFlow;
                v = e.from;
            }
            for (int i = 0; i < n; i++) {
                h[i] += d[i] == Long.MAX_VALUE ? 0 : d[i];
            }
        }
        return new long[]{flow, cost};
    }

    void dijkstra(int source, Edge[] lastEdge, final long[] d, long[] h) {
        TreeSet<Integer> ts = new TreeSet<Integer>(new Comparator<Integer>() {
            public int compare(Integer o1, Integer o2) {
                if (d[o1] != d[o2]) {
                    return d[o1] < d[o2] ? -1 : 1;
                }
                return o1 - o2;
            }
        });
        Arrays.fill(d, Long.MAX_VALUE);
        d[source] = 0;
        ts.add(source);
        while (!ts.isEmpty()) {
            int v = ts.pollFirst();
            for (Edge e : edges[v]) {
                if (e.flow >= e.cap) {
                    continue;
                }
                if (d[e.to] == Long.MAX_VALUE
                        || d[e.to] > d[e.from] + e.cost + h[e.from]
                        - h[e.to]) {
                    if (e.cost + h[e.from] - h[e.to] < 0) {
                        throw new AssertionError();
                    }
                    ts.remove(e.to);
                    d[e.to] = d[e.from] + e.cost + h[e.from] - h[e.to];
                    lastEdge[e.to] = e;
                    ts.add(e.to);
                }
            }
        }
    }
}


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

import static java.lang.Math.*;

public class Solution implements Runnable {

	class Edge {
		int from, to, u, f, c;

		public Edge(int from, int to, int u, int c) {
			this.from = from;
			this.to = to;
			this.u = u;
			this.c = c;
		}
	}

	int dr [] = new int [] {0, 0, 1, -1};
	int dc [] = new int [] {1, -1, 0, 0};

	int N, S, T;
	ArrayList<Edge> edges;
	ArrayList<Integer> g[];
	int [] d, pv, pe;
	boolean [] inQueue;

	void addEdge (int from, int to, int u, int c) {
		g[from].add(edges.size());
		edges.add(new Edge (from, to, u, c));
		g[to].add(edges.size());
		edges.add(new Edge (to, from, 0, -c));
	}

	int minCostMaxFlow () {
		int result = 0;

		d = new int [N];
		inQueue = new boolean [N];
		pe = new int [N];
		pv = new int [N];
		Queue<Integer> q = new ArrayDeque<>();

		while (true) {
			Arrays.fill(inQueue, false);
			Arrays.fill(d, Integer.MAX_VALUE / 2);
			d[S] = 0;
			inQueue[S] = true;
			q.add(S);
			while (!q.isEmpty()) {
				int v = q.poll();
				inQueue[v] = false;
				for (int i = 0; i < g[v].size(); i++) {
					int index = g[v].get(i);
					Edge e = edges.get(index);
					if (e.u > e.f) {
						if (d[e.to] > d[v] + e.c) {
							d[e.to] = d[v] + e.c;
							pv[e.to] = v;
							pe[e.to] = index;
							if (!inQueue[e.to]) {
								inQueue[e.to] = true;
								q.add(e.to);
							}
						}
					}
				}
			}
			if (d[T] == Integer.MAX_VALUE / 2) break;
			int addFlow = Integer.MAX_VALUE / 2;
			for (int v = T; v != S; v = pv[v]) {
				int index = pe[v];
				Edge e = edges.get(index);
				addFlow = min (addFlow, e.u - e.f);
			}
			for (int v = T; v != S; v = pv[v]) {
				int index = pe[v];
				Edge dir = edges.get(index);
				Edge rev = edges.get(index ^ 1);
				result += addFlow * dir.c;
				dir.f += addFlow;
				rev.f -= addFlow;
			}
		}
		return result;
	}

	public void solve() throws Exception {
		int n = sc.nextInt();
		int m = sc.nextInt();

		int a [][] = new int [n][m];
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < m; j++) {
				a[i][j] = sc.nextInt();
			}
		}

		N = n * m + 2;
		S = n * m;
		T = n * m + 1;

		edges = new ArrayList<>();

		g = new ArrayList[N];
		for (int i = 0; i < N; i++)
			g[i] = new ArrayList<>();

		for (int i = 0; i < n; i++) {
			for (int j = 0; j < m; j++) {
				if ((i + j) % 2 == 0) {
					addEdge(S, i * m + j, 1, 0);
					for (int k = 0; k < 4; k++) {
						int di = dr[k] + i;
						int dj = dc[k] + j;
						if (di >= 0 && dj >= 0 && di < n && dj < m) {
							int cost = 1;
							if (a[i][j] == a[di][dj]) cost = 0;
							addEdge(i * m + j, di * m + dj, 1, cost);
						}
					}
				} else {
					addEdge(i * m + j, T, 1, 0);
				}
			}
		}
		out.println(minCostMaxFlow());
	}

	BufferedReader in;
	PrintWriter out;
	FastScanner sc;

	static Throwable uncaught;

	@Override
	public void run() {
		try {
			in = new BufferedReader(new InputStreamReader(System.in));
			out = new PrintWriter(System.out);
			sc = new FastScanner(in);
			solve();
		} catch (Throwable t) {
			Solution.uncaught = t;
		} finally {
			out.close();
		}
	}

	public static void main(String[] args) throws Throwable {
		Thread t = new Thread(null, new Solution(), "", (1 << 26));
		t.start();
		t.join();
		if (uncaught != null) {
			throw uncaught;
		}
	}

}

class FastScanner {

	BufferedReader reader;
	StringTokenizer strTok;

	public FastScanner(BufferedReader reader) {
		this.reader = reader;
	}

	public String nextToken() throws IOException {
		while (strTok == null || !strTok.hasMoreTokens()) {
			strTok = new StringTokenizer(reader.readLine());
		}
		return strTok.nextToken();
	}

	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());
	}

}


import java.util.*;

public class C {
	private static Scanner in;

	public static final int[] dx = new int[]{1, 0, -1, 0};
	public static final int[] dy = new int[]{0, 1, 0, -1};

	public void run() {
		int hei = in.nextInt();
		int wid = in.nextInt();
		int s = hei * wid / 2;
		int[][] a = new int[hei][wid];
		for (int i = 0; i < hei; i++) {
			for (int j = 0; j < wid; j++) {
				a[i][j] = in.nextInt() - 1;
			}
		}
		int infty = 3 * s;
		int[][] e = new int[s][s];
		for (int i = 0; i < s; i++) {
			Arrays.fill(e[i], infty);
		}
		for (int i = 0; i < hei; i++) {
			for (int j = 0; j < wid; j++) {
				if ((i + j) % 2 == 0) {
					continue;
				}
				int x = (i * wid + j) / 2;
				for (int d = 0; d < 4; d++) {
					int ii = i + dx[d];
					int jj = j + dy[d];
					if (ii < 0 || jj < 0 || ii >= hei || jj >= wid) {
						continue;
					}
					int y = (ii * wid + jj) / 2;
					e[x][y] = (a[i][j] == a[ii][jj]) ? 0 : 1;
				}
			}
		}
		System.out.println(hungarian(e));
	}

	public static void main(String[] args) {
		Locale.setDefault(Locale.US);
		in = new Scanner(System.in);
		new C().run();
		in.close();
	}

	/*
	 * infty must be greater than all elements of e
	 */
	public static int hungarian(int[][] e) {
		int infty = Integer.MAX_VALUE / 3;
		int n1 = e.length;
		int n2 = e[0].length;
		int[] u = new int[n1 + 1];
		int[] v = new int[n2 + 1];
		int[] p = new int[n2 + 1];
		int[] way = new int[n2 + 1];
		for (int i = 1; i <= n1; i++) {
			p[0] = i;
			int j0 = 0;
			int[] minv = new int[n2 + 1];
			Arrays.fill(minv, infty);
			boolean[] used = new boolean[n2 + 1];
			do {
				used[j0] = true;
				int i0 = p[j0], j1 = 0;
				double delta = infty;
				for (int j = 1; j <= n2; j++) {
					if (!used[j]) {
						int cur = e[i0 - 1][j - 1] - u[i0] - v[j];
						if (cur < minv[j]) {
							minv[j] = cur;
							way[j] = j0;
						}
						if (minv[j] < delta) {
							delta = minv[j];
							j1 = j;
						}
					}
				}
				for (int j = 0; j <= n2; j++) {
					if (used[j]) {
						u[p[j]] += delta;
						v[j] -= delta;
					} else {
						minv[j] -= delta;
					}
				}
				j0 = j1;
			} while (p[j0] != 0);
			do {
				int j1 = way[j0];
				p[j0] = p[j1];
				j0 = j1;
			} while (j0 > 0);
		}
		int sum = 0;
		for (int j = 1; j <= n2; j++) {
			if (p[j] > 0) {
				// if (e[p[j] - 1][j - 1] >= infty) no matching of size n1;
				sum += e[p[j] - 1][j - 1];
			}
		}
		return sum;
	}
}