import java.io.*; import java.util.*; public class prog { BufferedReader br; PrintWriter out; StringTokenizer st; boolean eof; static final int P = 666013; int f(int n) { int ret = 0; int cur = 1; for (int i = n; i >= 1; i--) { cur = (int) ((long) cur * i % P); ret += cur; ret %= P; } return ret; } void solve() throws IOException { int n = nextInt(); int ret = (f(2 * n) - 2 * f(n)) % P; if (ret < 0) { ret += P; } out.println(ret); } prog() 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 prog(); } 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()); } }