import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.IOException;
import java.io.UncheckedIOException;
import java.io.Closeable;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) throws Exception {
        Thread thread = new Thread(null, new TaskAdapter(), "", 1 << 27);
        thread.start();
        thread.join();
    }

    static class TaskAdapter implements Runnable {
        @Override
        public void run() {
            InputStream inputStream = System.in;
            OutputStream outputStream = System.out;
            FastInput in = new FastInput(inputStream);
            FastOutput out = new FastOutput(outputStream);
            EPlacingRooks solver = new EPlacingRooks();
            solver.solve(1, in, out);
            out.close();
        }
    }

    static class EPlacingRooks {
        public void solve(int testNumber, FastInput in, FastOutput out) {
            int n = in.readInt();
            int k = in.readInt();
            Modular mod = new Modular(998244353);
            int m = n - k;

            if (k == 0) {
                int ans = 1;
                for (int i = 1; i <= n; i++) {
                    ans = mod.mul(ans, i);
                }
                out.println(ans);
                return;
            }
            if (m <= 0 || m > n) {
                out.println(0);
                return;
            }

            PrimeCombination combination = new PrimeCombination(n, mod);
            Power power = new Power(mod);
            int ans = 0;
            for (int i = 0; i <= m; i++) {
                int local = combination.combination(m, i);
                if (i % 2 == 1) {
                    local = mod.valueOf(-local);
                }
                local = mod.mul(local, power.pow(m - i, n));
                ans = mod.plus(ans, local);
            }
            ans = mod.mul(ans, combination.combination(n, m));

            ans = mod.mul(ans, 2);
            out.println(ans);
        }

    }

    static interface IntCombination {
    }

    static class FastOutput implements AutoCloseable, Closeable, Appendable {
        private StringBuilder cache = new StringBuilder(10 << 20);
        private final Writer os;

        public FastOutput append(CharSequence csq) {
            cache.append(csq);
            return this;
        }

        public FastOutput append(CharSequence csq, int start, int end) {
            cache.append(csq, start, end);
            return this;
        }

        public FastOutput(Writer os) {
            this.os = os;
        }

        public FastOutput(OutputStream os) {
            this(new OutputStreamWriter(os));
        }

        public FastOutput append(char c) {
            cache.append(c);
            return this;
        }

        public FastOutput append(int c) {
            cache.append(c);
            return this;
        }

        public FastOutput println(int c) {
            return append(c).println();
        }

        public FastOutput println() {
            cache.append(System.lineSeparator());
            return this;
        }

        public FastOutput flush() {
            try {
                os.append(cache);
                os.flush();
                cache.setLength(0);
            } catch (IOException e) {
                throw new UncheckedIOException(e);
            }
            return this;
        }

        public void close() {
            flush();
            try {
                os.close();
            } catch (IOException e) {
                throw new UncheckedIOException(e);
            }
        }

        public String toString() {
            return cache.toString();
        }

    }

    static class InverseNumber {
        int[] inv;

        public InverseNumber(int[] inv, int limit, Modular modular) {
            this.inv = inv;
            inv[1] = 1;
            int p = modular.getMod();
            for (int i = 2; i <= limit; i++) {
                int k = p / i;
                int r = p % i;
                inv[i] = modular.mul(-k, inv[r]);
            }
        }

        public InverseNumber(int limit, Modular modular) {
            this(new int[limit + 1], limit, modular);
        }

    }

    static class FastInput {
        private final InputStream is;
        private byte[] buf = new byte[1 << 20];
        private int bufLen;
        private int bufOffset;
        private int next;

        public FastInput(InputStream is) {
            this.is = is;
        }

        private int read() {
            while (bufLen == bufOffset) {
                bufOffset = 0;
                try {
                    bufLen = is.read(buf);
                } catch (IOException e) {
                    bufLen = -1;
                }
                if (bufLen == -1) {
                    return -1;
                }
            }
            return buf[bufOffset++];
        }

        public void skipBlank() {
            while (next >= 0 && next <= 32) {
                next = read();
            }
        }

        public int readInt() {
            int sign = 1;

            skipBlank();
            if (next == '+' || next == '-') {
                sign = next == '+' ? 1 : -1;
                next = read();
            }

            int val = 0;
            if (sign == 1) {
                while (next >= '0' && next <= '9') {
                    val = val * 10 + next - '0';
                    next = read();
                }
            } else {
                while (next >= '0' && next <= '9') {
                    val = val * 10 - next + '0';
                    next = read();
                }
            }

            return val;
        }

    }

    static class PrimeCombination implements IntCombination {
        final Factorial factorial;
        final Modular modular;

        public PrimeCombination(Factorial factorial) {
            this.factorial = factorial;
            this.modular = factorial.getModular();
        }

        public PrimeCombination(int limit, Modular modular) {
            this(new Factorial(limit, modular));
        }

        public int combination(int m, int n) {
            if (n > m) {
                return 0;
            }
            return modular.mul(modular.mul(factorial.fact(m), factorial.invFact(n)), factorial.invFact(m - n));
        }

    }

    static class Modular {
        int m;

        public int getMod() {
            return m;
        }

        public Modular(int m) {
            this.m = m;
        }

        public Modular(long m) {
            this.m = (int) m;
            if (this.m != m) {
                throw new IllegalArgumentException();
            }
        }

        public Modular(double m) {
            this.m = (int) m;
            if (this.m != m) {
                throw new IllegalArgumentException();
            }
        }

        public int valueOf(int x) {
            x %= m;
            if (x < 0) {
                x += m;
            }
            return x;
        }

        public int valueOf(long x) {
            x %= m;
            if (x < 0) {
                x += m;
            }
            return (int) x;
        }

        public int mul(int x, int y) {
            return valueOf((long) x * y);
        }

        public int plus(int x, int y) {
            return valueOf(x + y);
        }

        public String toString() {
            return "mod " + m;
        }

    }

    static class Factorial {
        int[] fact;
        int[] inv;
        Modular modular;

        public Modular getModular() {
            return modular;
        }

        public Factorial(int[] fact, int[] inv, InverseNumber in, int limit, Modular modular) {
            this.modular = modular;
            this.fact = fact;
            this.inv = inv;
            fact[0] = inv[0] = 1;
            for (int i = 1; i <= limit; i++) {
                fact[i] = modular.mul(fact[i - 1], i);
                inv[i] = modular.mul(inv[i - 1], in.inv[i]);
            }
        }

        public Factorial(int limit, Modular modular) {
            this(new int[limit + 1], new int[limit + 1], new InverseNumber(limit, modular), limit, modular);
        }

        public int fact(int n) {
            return fact[n];
        }

        public int invFact(int n) {
            return inv[n];
        }

    }

    static class Power {
        final Modular modular;

        public Power(Modular modular) {
            this.modular = modular;
        }

        public int pow(int x, int n) {
            if (n == 0) {
                return modular.valueOf(1);
            }
            long r = pow(x, n >> 1);
            r = modular.valueOf(r * r);
            if ((n & 1) == 1) {
                r = modular.valueOf(r * x);
            }
            return (int) r;
        }

    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.StringTokenizer;
import java.io.BufferedReader;
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);
        EPlacingRooks solver = new EPlacingRooks();
        solver.solve(1, in, out);
        out.close();
    }

    static class EPlacingRooks {
        NumberTheory.Mod998 mod = new NumberTheory.Mod998();

        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            long k = in.nextLong();
            if (k == 0) {
                out.println(mod.fact(n));
                return;
            }

            if (k > n - 1) {
                out.println(0);
                return;
            }

            // This is the number of columns that are non-empty.
            int c = (int) (n - k);

            long answer = 0;
            for (int i = 1; i <= c; i++) {
                // i is the number of allowable columns to put things
                answer = mod.add(answer, mod.mult(mod.paritySign(c - i), mod.ncr(c, i), mod.pow(i, n)));
            }

            // Multiply by 2 C(n, c) because we want to pick c rows or c columns.
            answer = mod.mult(answer, 2, mod.ncr(n, c));

            out.println(answer);
        }

    }

    static class NumberTheory {
        private static void ASSERT(boolean assertion) {
            if (!assertion)
                throw new AssertionError();
        }

        public abstract static class Modulus<M extends NumberTheory.Modulus<M>> {
            final ArrayList<Long> factorial = new ArrayList<>();
            final ArrayList<Long> invFactorial = new ArrayList<>();

            public abstract long modulus();

            public Modulus() {
                super();
                factorial.add(1L);
                invFactorial.add(1L);
            }

            public long fact(int n) {
                while (factorial.size() <= n) {
                    factorial.add(mult(factorial.get(factorial.size() - 1), factorial.size()));
                }

                return factorial.get(n);
            }

            public long fInv(int n) {
                int lastKnown = invFactorial.size() - 1;

                if (lastKnown < n) {
                    long[] fInv = new long[n - lastKnown];
                    fInv[0] = inv(fact(n));
                    for (int i = 1; i < fInv.length; i++) {
                        fInv[i] = mult(fInv[i - 1], n - i + 1);
                    }
                    for (int i = fInv.length - 1; i >= 0; i--) {
                        invFactorial.add(fInv[i]);
                    }
                }

                return invFactorial.get(n);
            }

            public long paritySign(long k) {
                return (k & 1) == 0 ? 1 : modulus() - 1;
            }

            public long ncr(int n, int r) {
                ASSERT(n >= 0);
                if (r < 0 || n < r)
                    return 0;
                return mult(fact(n), mult(fInv(r), fInv(n - r)));
            }

            public long normalize(long x) {
                x %= modulus();
                if (x < 0)
                    x += modulus();
                return x;
            }

            public long add(long a, long b) {
                long v = a + b;
                return v < modulus() ? v : v - modulus();
            }

            public long mult(long... x) {
                long r = 1;
                for (long i : x)
                    r = mult(r, i);
                return r;
            }

            public long mult(long a, long b) {
                return (a * b) % modulus();
            }

            public long pow(long x, int e) {
                if (e < 0) {
                    x = inv(x);
                    e *= -1;
                }
                if (e == 0)
                    return 1;
                if ((e & 1) > 0)
                    return mult(x, pow(x, e - 1));
                return pow(mult(x, x), e / 2);
            }

            public long inv(long value) {
                long g = modulus(), x = 0, y = 1;
                for (long r = value; r != 0; ) {
                    long q = g / r;
                    g %= r;

                    long temp = g;
                    g = r;
                    r = temp;

                    x -= q * y;

                    temp = x;
                    x = y;
                    y = temp;
                }

                ASSERT(g == 1);
                ASSERT(y == modulus() || y == -modulus());

                return normalize(x);
            }

        }

        public static class Mod998 extends NumberTheory.Modulus<NumberTheory.Mod998> {
            public long modulus() {
                return 998_244_353L;
            }

        }

    }

    static class InputReader {
        public final 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());
        }

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

    }
}


public class Main {

  private static void solve() {
    int mod = 998244353;
    int n = ni();
    long k = nl();

    if ((long) n <= k) {
      System.out.println(0);
    } else if (k == 0) {
      long ret = 1;
      for (int i = 1; i <= n; i++) {
        ret *= i;
        ret %= mod;
      }
      System.out.println(ret);
    } else {
      int m = (int) k;
      int[][] fif = enumFIF(n * 3, mod);
      long ret = 0;

      for (int i = n - m, s = 0; i >= 1; i--, s++) {
        long x = C(n, i, mod, fif);
        x *= pow(i, n, mod);
        x %= mod;
        x *= C(n - i, m, mod, fif);
        x %= mod;

        if (s % 2 == 0) {
          ret += x;
        } else {
          ret += mod - x;
        }
        ret %= mod;
      }
      System.out.println(ret * 2 % mod);
    }
  }

  public static long pow(long a, long n, long mod) {
    // a %= mod;
    long ret = 1;
    int x = 63 - Long.numberOfLeadingZeros(n);
    for (; x >= 0; x--) {
      ret = ret * ret % mod;
      if (n << 63 - x < 0)
        ret = ret * a % mod;
    }
    return ret;
  }

  public static long C(int n, int r, int mod, int[][] fif) {
    if (n < 0 || r < 0 || r > n)
      return 0;
    return (long) fif[0][n] * fif[1][r] % mod * fif[1][n - r] % mod;
  }

  public static int[][] enumFIF(int n, int mod) {
    int[] f = new int[n + 1];
    int[] invf = new int[n + 1];
    f[0] = 1;
    for (int i = 1; i <= n; i++) {
      f[i] = (int) ((long) f[i - 1] * i % mod);
    }
    long a = f[n];
    long b = mod;
    long p = 1, q = 0;
    while (b > 0) {
      long c = a / b;
      long d;
      d = a;
      a = b;
      b = d % b;
      d = p;
      p = q;
      q = d - c * q;
    }
    invf[n] = (int) (p < 0 ? p + mod : p);
    for (int i = n - 1; i >= 0; i--) {
      invf[i] = (int) ((long) invf[i + 1] * (i + 1) % mod);
    }
    return new int[][] {f, invf};
  }

  public static void main(String[] args) {
    new Thread(null, new Runnable() {
      @Override
      public void run() {
        long start = System.currentTimeMillis();
        String debug = args.length > 0 ? args[0] : null;
        if (debug != null) {
          try {
            is = java.nio.file.Files.newInputStream(java.nio.file.Paths.get(debug));
          } catch (Exception e) {
            throw new RuntimeException(e);
          }
        }
        reader = new java.io.BufferedReader(new java.io.InputStreamReader(is), 32768);
        solve();
        out.flush();
        tr((System.currentTimeMillis() - start) + "ms");
      }
    }, "", 64000000).start();
  }

  private static java.io.InputStream is = System.in;
  private static java.io.PrintWriter out = new java.io.PrintWriter(System.out);
  private static java.util.StringTokenizer tokenizer = null;
  private static java.io.BufferedReader reader;

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

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

  private static long nl() {
    return Long.parseLong(next());
  }

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

  private static char[] ns() {
    return next().toCharArray();
  }

  private static long[] nal(int n) {
    long[] a = new long[n];
    for (int i = 0; i < n; i++)
      a[i] = nl();
    return a;
  }

  private static int[][] ntable(int n, int m) {
    int[][] table = new int[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        table[i][j] = ni();
      }
    }
    return table;
  }

  private static int[][] nlist(int n, int m) {
    int[][] table = new int[m][n];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        table[j][i] = ni();
      }
    }
    return table;
  }

  private static int ni() {
    return Integer.parseInt(next());
  }

  private static void tr(Object... o) {
    if (is != System.in)
      System.out.println(java.util.Arrays.deepToString(o));
  }
}


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

public class utkarsh {

    BufferedReader br;
    PrintWriter out;

    long mod = (long) (1e9 + 7), inf = (long) (3e18);

    long fact[], inv[];

    long nCr(int n, int r) {
        return fact[n] * inv[n-r] % mod * inv[r] % mod;
    }

    void solve() {
        mod = 998244353L;
        int n = ni();
        long k = nl();
        if(k >= n)  out.println(0);
        else {
            fact = new long[n+1];
            inv = new long[n+1];
            fact[0] = inv[0] = 1;
            for(int i = 1; i <= n; i++) fact[i] = (fact[i-1] * i) % mod;
            inv[n] = mp(fact[n], mod - 2);
            for(int i = n-1; i >= 1; i--)   inv[i] = ((i+1) * inv[i+1]) % mod;

            if(k == 0)  out.println(fact[n]);
            else {
                int r = n - (int)k;
                long ans = 0;
                int p = 1;
                for(int i = 0; i < r; i++) {
                    ans = (ans + p * nCr(r, i) * mp(r - i, n) % mod) % mod;
                    if(ans < 0) ans += mod;
                    p *= -1;
                }
                out.println((2 * nCr(n, r) * ans) % mod);
            }
        }
    }

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

    long mp(long b, long e) {
        long r = 1;
        while(e > 0) {
            if( (e&1) == 1 )    r = (r * b) % mod;
            b = (b * b) % mod;
            e >>= 1;
        }
        return r;
    }

    // -------- I/O Template -------------

    char nc() {
        return ns().charAt(0);
    }

    String nLine() {
        try {
            return br.readLine();
        } catch(IOException e) {
            return "-1";
        }
    }

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

    long nl() {
        return Long.parseLong(ns());
    }

    int ni() {
        return Integer.parseInt(ns());
    }

    StringTokenizer ip;

    String ns() {
        if(ip == null || !ip.hasMoreTokens()) {
            try {
                ip = new StringTokenizer(br.readLine());
            } catch(IOException e) {
                throw new InputMismatchException();
            }
        }
        return ip.nextToken();
    }

    void run() {
        br = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);
        solve();
        out.flush();
    }

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


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

public class E1342 {

	static long mod = 998244353;

	static long modPow(long a, long e) // O(log e)
	{
		a %= mod;
		long res = 1;
		while (e > 0) {
			if ((e & 1) == 1)
				res = (res * a) % mod;
			a = (a * a) % mod;
			e >>= 1;
		}
		return res;
	}

	static long[] fac, invfac;

	public static long nck(long n, long k) {
		return fac[(int) n] * invfac[(int) k] % mod * invfac[(int) (n - k)] % mod;
	}

	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		PrintWriter pw = new PrintWriter(System.out);
		long n = sc.nextInt();
		long k = sc.nextLong();
		if (k >= n) {
			pw.println(0);
			pw.close();
			return;
		}
		fac = new long[(int) n + 1];
		invfac = new long[(int) n + 1];
		fac[0] = 1;
		for (int i = 1; i < fac.length; i++) {
			fac[i] = (i * fac[i - 1]) % mod;
		}
		invfac[0] = 1;
		for (int i = 1; i < invfac.length; i++) {
			invfac[i] = (invfac[i - 1] * modPow(i, mod - 2)) % mod;
		}
		long m = n - k;
		long posans = 0;
		long negans = 0;
		for (int i = 0; i <= m; i++) {
			if (i % 2 == 0) {
				posans += modPow(m - i, n) * nck(m, i) % mod;
				posans %= mod;
			} else {
				negans += modPow(m - i, n) * nck(m, i) % mod;
				negans %= mod;
			}
		}
		long ans = (posans - negans + 2 * mod) % mod;
		ans *= nck(n, m);
		ans %= mod;
		if (m != n) {
			ans *= 2;
		}
		ans %= mod;
		pw.println(ans);
		pw.close();
	}

	static class Scanner {
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s) {
			br = new BufferedReader(new InputStreamReader(s));
		}

		public Scanner(FileReader r) {
			br = new BufferedReader(r);
		}

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

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

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

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

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

		public int[] nextIntArr(int n) throws IOException {
			int[] arr = new int[n];
			for (int i = 0; i < arr.length; i++)
				arr[i] = nextInt();
			return arr;
		}

		public boolean ready() throws IOException {
			return br.ready();
		}

	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.*;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.*;
import java.util.Arrays;
import java.util.Comparator;
import java.util.List;
import java.util.StringTokenizer;
import java.util.function.*;
import java.util.function.IntPredicate;
import java.util.function.IntToLongFunction;
import java.util.function.IntUnaryOperator;
import java.util.stream.*;

public class E {

    private static final FastReader in = new FastReader();
    private static final FastWriter out = new FastWriter();

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

    private void run() {
        var t = 1;
        while (t-- > 0) {
            solve();
        }

        out.flush();
    }

    private void solve() {
        var n = in.nextInt();
        var kt = in.nextLong();

        if (kt >= n) {
            out.println(0);
            return;
        }

        var k = (int) kt;
        var mod = new Modulo(998244353);
        var facts = mod.factorials(n);

        var ans = 0L;
        var c = n - k;
        for (var i = 0; i <= c; i++) {
            var t = mod.times(mod.combination(c, i, facts), mod.pow(c - i, n));
            if (i % 2 == 0) {
                ans = mod.plus(ans, t);
            } else {
                ans = mod.minus(ans, t);
            }
        }
        ans = mod.times(ans, mod.combination(n, n - k, facts));

        if (k > 0) ans = mod.times(ans, 2);
        out.println(ans);
    }

}

class FastReader {

    private static final BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    private static StringTokenizer in;

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

    public BigDecimal nextBigDecimal() {
        return new BigDecimal(next());
    }

    public BigInteger nextBigInteger() {
        return new BigInteger(next());
    }

    public boolean nextBoolean() {
        return Boolean.valueOf(next());
    }

    public byte nextByte() {
        return Byte.valueOf(next());
    }

    public double nextDouble() {
        return Double.valueOf(next());
    }

    public double[] nextDoubleArray(int length) {
        var a = new double[length];
        for (var i = 0; i < length; i++) {
            a[i] = nextDouble();
        }
        return a;
    }

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

    public int[] nextIntArray(int length) {
        var a = new int[length];
        for (var i = 0; i < length; i++) {
            a[i] = nextInt();
        }
        return a;
    }

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

    public long[] nextLongArray(int length) {
        var a = new long[length];
        for (var i = 0; i < length; i++) {
            a[i] = nextLong();
        }
        return a;
    }

}

class FastWriter extends PrintWriter {

    public FastWriter() {
        super(System.out);
    }

    public void println(boolean[] a) {
        for (var i = 0; i < a.length; i++) {
            print(a[i]);
            print(i + 1 < a.length ? ' ' : '\n');
        }
    }

    public void println(double[] a) {
        for (var i = 0; i < a.length; i++) {
            print(a[i]);
            print(i + 1 < a.length ? ' ' : '\n');
        }
    }

    public void println(int[] a) {
        for (var i = 0; i < a.length; i++) {
            print(a[i]);
            print(i + 1 < a.length ? ' ' : '\n');
        }
    }

    public void println(long[] a) {
        for (var i = 0; i < a.length; i++) {
            print(a[i]);
            print(i + 1 < a.length ? ' ' : '\n');
        }
    }

    public void println(Object... a) {
        for (var i = 0; i < a.length; i++) {
            print(a[i]);
            print(i + 1 < a.length ? ' ' : '\n');
        }
    }

    public <T> void println(List<T> l) {
        println(l.toArray());
    }

    public void debug(String name, Object o) {
        String value = Arrays.deepToString(new Object[] { o });
        value = value.substring(1, value.length() - 1);
        System.err.println(name + " => " + value);
    }

}

class MathUtils {

    public static final double EPS = 1e-12;

    public static final Comparator<Double> EPS_COMPARATOR = (x, y) -> {
        if (x + EPS < y) {
            return -1;
        } else if (x - EPS > y) {
            return 1;
        } else {
            return 0;
        }
    };

    public static int compare(double x, double y) {
        return EPS_COMPARATOR.compare(x, y);
    }

    /**
     * Returns the index of the first element in the range [left, right) which leftShouldAdvance tested to
     * be false.
     */
    public static int binarySearch(int left, int right, IntPredicate leftShouldAdvance) {
        while (left < right) {
            var mid = left + (right - left) / 2;
            if (leftShouldAdvance.test(mid)) {
                left = mid + 1;
            } else {
                right = mid;
            }
        }

        return left;
    }

    /**
     * Returns the index of the first element in a which >= x.
     */
    public static int lowerBound(int[] a, int x) {
        return binarySearch(0, a.length, mid -> a[mid] < x);
    }

    public static int lowerBound(long[] a, long x) {
        return binarySearch(0, a.length, mid -> a[mid] < x);
    }

    /**
     * Returns the index of the first element in a which > x.
     */
    public static int upperBound(int[] a, int x) {
        return binarySearch(0, a.length, mid -> a[mid] <= x);
    }

    public static int upperBound(long[] a, long x) {
        return binarySearch(0, a.length, mid -> a[mid] <= x);
    }

    /**
     * Searches for the maximum value of a unimodal function f(x).
     *

     * A function f(x) is a unimodal function if for some value m, it is monotonically increasing for x ≤
     * m and monotonically decreasing for x ≥ m. In that case, the maximum value of f(x) is f(m) and there are no
     * other local maxima.
     */
    public static int ternarySearchMaxInt(int left, int right, IntUnaryOperator f) {
        return binarySearch(left, right, mid -> f.applyAsInt(mid) < f.applyAsInt(Math.min(mid + 1, right - 1)));
    }

    public static int ternarySearchMaxLong(int left, int right, IntToLongFunction f) {
        return binarySearch(left, right, mid -> f.applyAsLong(mid) < f.applyAsLong(Math.min(mid + 1, right - 1)));
    }

    public static long gcd(long a, long b) {
        while (b > 0) {
            var t = a % b;
            a = b;
            b = t;
        }
        return a;
    }

    /**
     * Solves x and y such that ax + by = gcd(a, b).
     */
    public static long extendedEuclidean(long a, long b, long[] xy) {
        if (b == 0L) {
            xy[0] = 1L;
            xy[1] = 0L;

            return a;
        }

        var r = extendedEuclidean(b, a % b, xy);
        var t = xy[0];
        xy[0] = xy[1];
        xy[1] = t - a / b * xy[1];

        return r;
    }

    public static long lcm(long a, long b) {
        return a / gcd(a, b) * b;
    }

}

// all a, b < mod
class Modulo {

    private final long mod;

    public Modulo(long mod) {
        this.mod = mod;
    }

    public long plus(long a, long b) {
        var c = a + b;
        if (c >= mod) {
            c -= mod;
        }
        return c;
    }

    public long minus(long a, long b) {
        var c = a - b;
        if (c < 0) {
            c += mod;
        }
        return c;
    }

    public long times(long a, long b) {
        return a * b % mod;
    }

    public long div(long a, long b) {
        return times(a, pow(b, mod - 2));
    }

    public long pow(long a, long b) {
        long c = 1;

        while (b > 0) {
            if ((b & 1) > 0) {
                c = c * a % mod;
            }
            a = a * a % mod;
            b >>= 1;
        }

        return c;
    }

    public long combination(int n, int k) {
        return div(factorial(n), times(factorial(k), factorial(n - k)));
    }

    public long combination(int n, int k, long[] factorials) {
        return div(factorials[n], times(factorials[k], factorials[n - k]));
    }

    public long factorial(int n) {
        var f = 1L;
        for (var i = 1; i <= n; i++) {
            f = f * i % mod;
        }
        return f;
    }

    public long[] factorials(int n) {
        var f = new long[n + 1];
        f[0] = 1L;
        for (var i = 1; i <= n; i++) {
            f[i] = f[i - 1] * i % mod;
        }
        return f;
    }

}


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

public class tr0 {
	static PrintWriter out;
	static StringBuilder sb;
	static int mod = 998244353;
	static long inf = (long) 1e18 + 1;
	static int[] col;
	static int n, m;
	static ArrayList<Integer>[] ad;
	static long[][][] memo;
	static HashSet<Integer> h;
	static int[] a;
	static Integer[][] g;

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		out = new PrintWriter(System.out);
		int n = sc.nextInt();
		long k = sc.nextLong();
		if (k >= n) {
			System.out.println(0);
			return;
		}
		long[] fac = new long[n + 1];
		fac[0] = 1;
		for (int i = 0; i < n; i++)
			fac[i + 1] = (i + 1) * fac[i] % mod;
		if (k == 0) {
			System.out.println(fac[n]);
			return;
		}
		int k1 = (int) k;
		int c = n - k1;
		long ans = fac[n] * modPow(fac[c], mod - 2) % mod;
		ans = ans*modPow(fac[n - c], mod - 2)%mod;

		long tem = 0;
		for (int i = 0; i <= c; i++)
			if (i % 2 == 0) {
				long tem1 = fac[c] * modPow(fac[i], mod - 2) % mod;
				tem1 = tem1 * modPow(fac[c - i], mod - 2) % mod;
				tem1 = tem1 * modPow(c - i, n) % mod;
				tem = (tem1 + tem) % mod;
			} else {
				long tem1 = fac[c] * modPow(fac[i], mod - 2) % mod;
				tem1 = tem1 * modPow(fac[c - i], mod - 2) % mod;
				tem1 = tem1 * modPow(c - i, n) % mod;
				tem = (-tem1 + tem + mod) % mod;
			}
		ans = ans * tem * 2 % mod;
		System.out.println(ans);
		out.flush();
	}

	static long modPow(long a, long e)

	{
		long res = 1;
		while (e > 0) {
			if ((e & 1) == 1)
				res = (res * a) % mod;
			a = (a * a) % mod;
			e >>= 1;
		}
		return res;
	}

	static class Scanner {
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream system) {
			br = new BufferedReader(new InputStreamReader(system));
		}

		public Scanner(String file) throws Exception {
			br = new BufferedReader(new FileReader(file));
		}

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

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

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

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

		public char nextChar() throws IOException {
			return next().charAt(0);
		}

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

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

		public long[] nextArrLong(int n) throws IOException {
			long[] a = new long[n];
			for (int i = 0; i < n; i++)
				a[i] = nextLong();
			return a;
		}

		public boolean ready() throws IOException {
			return br.ready();
		}

		public void waitForInput() throws InterruptedException {
			Thread.sleep(3000);
		}
	}
}


import java.util.function.BiFunction;
import java.util.function.IntUnaryOperator;
import java.util.function.LongBinaryOperator;
import java.util.function.LongUnaryOperator;

public class Main {

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

	public Main() {
		FastScanner fs = new FastScanner();
		java.io.PrintWriter out = new java.io.PrintWriter(System.out);
		solve(fs, out);
		out.flush();
		//if (fs.hasNext()) throw new AssertionError("read input");
	}

	public void solve(FastScanner fs, java.io.PrintWriter out) {
		int n = fs.nextInt();
		long k = fs.nextLong();
		final long[] fact = new long[n + 1], inv = new long[n + 1];
		final int MOD = 998244353;
		fact[0] = 1;
		for (int i = 0;i < n;++ i) fact[i + 1] = fact[i] * (i + 1) % MOD;
		inv[n] = IntMath.pow((int)fact[n], MOD - 2, MOD);
		for (int i = n;i > 0;-- i) inv[i - 1] = inv[i] * i % MOD;
		BiFunction<Integer, Integer, Long> comb = (i, j) -> fact[i] * inv[j] % MOD * inv[i - j] % MOD;
		if (k == 0) out.println(fact[n]);
		else if (k > n) out.println(0);
		else {
			int k2 = (int)k, k3 = n - k2;
			long ans = 0;
			for (int i = 1;i <= k3;++ i) {
				long tmp = comb.apply(k3, i) * IntMath.pow(i, n, MOD) % MOD;
				ans += (k3 - i & 1) != 0 ? -tmp : tmp;
			}
			ans = (ans % MOD + MOD) % MOD;
			ans = ans * 2 * comb.apply(n, k2) % MOD;
			out.println(ans);
		}
	}

	static class FastScanner {
		private final java.io.InputStream in = System.in;
		private final byte[] buffer = new byte[1024];
		private int ptr = 0;
		private int buflen = 0;
		private boolean hasNextByte() {
			if (ptr < buflen) return true;
			ptr = 0;
			try {
				buflen = in.read(buffer);
			} catch (java.io.IOException e) {
				e.printStackTrace();
			}
			return buflen > 0;
		}
		private byte readByte() {
			return hasNextByte() ? buffer[ptr++ ] : -1;
		}
		private static boolean isPrintableChar(byte c) {
			return 32 < c || c < 0;
		}
		private static boolean isNumber(int c) {
			return '0' <= c && c <= '9';
		}
		public boolean hasNext() {
			while (hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++ ;
			return hasNextByte();
		}
		public String next() {
			if (!hasNext()) throw new java.util.NoSuchElementException();
			StringBuilder sb = new StringBuilder();
			byte b;
			while (isPrintableChar(b = readByte())) sb.appendCodePoint(b);
			return sb.toString();
		}
		public final long nextLong() {
			if (!hasNext()) throw new java.util.NoSuchElementException();
			long n = 0;
			try {
				byte b = readByte();
				if (b == '-') {
					while(isNumber(b = readByte())) n = n * 10 + '0' - b;
					return n;
				} else if (!isNumber(b)) throw new NumberFormatException();
				do n = n * 10 + b - '0'; while (isNumber(b = readByte()));
			} catch (java.util.NoSuchElementException e) {
			}
			return n;
		}
		public final int nextInt() {
			if (!hasNext()) throw new java.util.NoSuchElementException();
			int n = 0;
			try {
				byte b = readByte();
				if (b == '-') {
					while(isNumber(b = readByte())) n = n * 10 + '0' - b;
					return n;
				} else if (!isNumber(b)) throw new NumberFormatException();
				do n = n * 10 + b - '0'; while (isNumber(b = readByte()));
			} catch (java.util.NoSuchElementException e) {
			}
			return n;
		}
		public double nextDouble() {
			return Double.parseDouble(next());
		}
	}
	public static class Arrays {
		public static void sort(final int[] array) {
			int l, min = 0xFFFFFFFF, max = 0;
			for (l = 0;l < array.length;++ l) {
				int i = array[l];
				min &= i;
				max |= i;
				if ((i & 0x80000000) == 0) break;
			}
			for (int r = l + 1;r < array.length;++ r) {
				int i = array[r];
				min &= i;
				max |= i;
				if ((i & 0x80000000) != 0) {
					array[r] = array[l];
					array[l ++] = i;
				}
			}
			int use = min ^ max, bit = Integer.highestOneBit(use & 0x7FFFFFFF);
			if (bit == 0) return;
			sort(array, 0, l, use, bit);
			sort(array, l, array.length, use, bit);
		}
		private static void sort(final int[] array, final int left, final int right, final int use, int digit) {
			if (right - left <= 96) {
				for (int i = left + 1;i < right;++ i) {
					int tmp = array[i], tmp2, j;
					for (j = i;j > left && (tmp2 = array[j - 1]) > tmp;-- j) array[j] = tmp2;
					array[j] = tmp;
				}
				return;
			}
			int l = left;
			while(l < right && (array[l] & digit) == 0) ++ l;
			for (int r = l + 1;r < right;++ r) {
				int i = array[r];
				if ((i & digit) == 0) {
					array[r] = array[l];
					array[l ++] = i;
				}
			}
			if ((digit = Integer.highestOneBit(use & digit - 1)) == 0) return;
			sort(array, left, l, use, digit);
			sort(array, l, right, use, digit);
		}
		public static void sort(final long[] array) {
			int l;
			long min = 0xFFFFFFFFFFFFFFFFL, max = 0;
			for (l = 0;l < array.length;++ l) {
				long i = array[l];
				min &= i;
				max |= i;
				if ((i & 0x8000000000000000L) == 0) break;
			}
			for (int r = l + 1;r < array.length;++ r) {
				long i = array[r];
				min &= i;
				max |= i;
				if ((i & 0x8000000000000000L) != 0) {
					array[r] = array[l];
					array[l ++] = i;
				}
			}
			long use = min ^ max, bit = Long.highestOneBit(use & 0x7FFFFFFFFFFFFFFFL);
			if (bit == 0) return;
			sort(array, 0, l, use, bit);
			sort(array, l, array.length, use, bit);
		}
		private static void sort(final long[] array, final int left, final int right, final long use, long digit) {
			if (right - left <= 96) {
				for (int i = left + 1, j;i < right;++ i) {
					long tmp = array[i], tmp2;
					for (j = i;j > left && (tmp2 = array[j - 1]) > tmp;-- j) array[j] = tmp2;
					array[j] = tmp;
				}
				return;
			}
			int l = left;
			while(l < right && (array[l] & digit) == 0) ++ l;
			for (int r = l + 1;r < right;++ r) {
				long i = array[r];
				if ((i & digit) == 0) {
					array[r] = array[l];
					array[l ++] = i;
				}
			}
			if ((digit = Long.highestOneBit(use & digit - 1)) == 0) return;
			sort(array, left, l, use, digit);
			sort(array, l, right, use, digit);
		}
	}

	public static class IntMath {
		public static int gcd(int a, int b) {
			while (a != 0) if ((b %= a) != 0) a %= b; else return a;
			return b;
		}
		public static int gcd(int... array) {
			int ret = array[0];
			for (int i = 1;i < array.length;++ i) ret = gcd(ret, array[i]);
			return ret;
		}
		public static long gcd(long a, long b) {
			while (a != 0) if ((b %= a) != 0) a %= b; else return a;
			return b;
		}
		public static long gcd(long... array) {
			long ret = array[0];
			for (int i = 1;i < array.length;++ i) ret = gcd(ret, array[i]);
			return ret;
		}
		public static long lcm(long a, long b) {
			return a / gcd(a, b) * b;
		}
		public static int pow(int a, int b) {
			int ans = 1;
			for (int mul = a;b > 0;b >>= 1, mul *= mul) if ((b & 1) != 0) ans *= mul;
			return ans;
		}
		public static int pow(int a, int b, int mod) {
			if (b < 0) b = b % (mod - 1) + mod - 1;
			long ans = 1;
			for (long mul = a;b > 0;b >>= 1, mul = mul * mul % mod) if ((b & 1) != 0) ans = ans * mul % mod;
			return (int)ans;
		}
		public static int floorsqrt(long n) {
			return (int)Math.sqrt(n + 0.1);
		}
		public static int ceilsqrt(long n) {
			return n <= 1 ? (int)n : (int)Math.sqrt(n - 0.1) + 1;
		}
	}
}


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

public class Main{
    static long MOD = 998244353 ;
    static long [] fac;
    public static void main(String[] args) {
        MyScanner sc = new MyScanner();
        out = new PrintWriter(new BufferedOutputStream(System.out));
        // Start writing your solution here. -------------------------------------
        //int t = sc.nextInt();
        int t = 1;
        while(t-- > 0)
        {
           int n = sc.nextInt();
           long kk = sc.nextLong();
           fac = new long[n + 1];
           fac[0] = fac[1] = 1l;
           for(int i = 2; i <= n; i++) fac[i] = (fac[i - 1] * i) % MOD;
           if(kk == 0) out.println(fac[n]);
           else if(kk >= n) out.println(0);
           else
           {
               int k = (int) kk;
               long tmp = 0l, sign = 1;
               int l = n - k;
               for(int i = 0; i <= l; i++)
               {
                   tmp = (tmp + MOD + (quickPOW(l - i, n) * C(l, l - i) * sign % MOD)) % MOD;
                   sign *= -1l;
               }
               long res = 2l * C(n , k) * tmp % MOD;
               out.println(res);
           }
        }
        out.close();
    }
    public static long C(int n, int m)
    {
        if(m == 0 || m == n) return 1l;
        if(m > n || m < 0) return 0l;
        long res = fac[n] * quickPOW((fac[m] * fac[n - m]) % MOD, MOD - 2) % MOD;

        return res;
    }
    public static long quickPOW(long n, long m)
    {
        long ans = 1l;
        while(m > 0)
        {
            if(m % 2 == 1)
                ans = (ans * n) % MOD;
            n = (n * n) % MOD;
            m >>= 1;
        }
        return ans;
    }
    public static int gcd(int a, int b)
    {
        if(a % b == 0) return b;
        return gcd(b, a % b);
    }
    public static long solve(long x, long[] res){
        int n = res.length;
        long a = x / n;
        int b = (int)(x % n);
        return res[n - 1] * a + res[b];
    }
    //-----------PrintWriter for faster output---------------------------------
    public static PrintWriter out;
    //-----------MyScanner class for faster input----------
    public static class MyScanner {
        BufferedReader br;
        StringTokenizer st;

        public MyScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }
        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
        int nextInt() {
            return Integer.parseInt(next());
        }
        long nextLong() {
            return Long.parseLong(next());
        }
        double nextDouble() {
            return Double.parseDouble(next());
        }
        String nextLine(){
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
    //--------------------------------------------------------
}


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

import static java.lang.Math.*;
import static java.util.Arrays.*;

// editorial sol, tle on test 24

public class cf1342e {

    static int[] fact;

    public static void main(String[] args) throws IOException {
        int n = rni(), k, ans = 0, mult = 1;
        fact = new int[n + 1];
        ifact = new int[n + 1];
        long kl = nl();
        if(kl >= n) {
            prln(0);
            close();
            return;
        }
        k = (int)kl;
        fact[0] = fact[1] = 1;
        for(int i = 2; i <= n; ++i) {
            fact[i] = fmul(fact[i - 1], i);
        }
        for(int i = 0; i <= n - k; ++i, mult = -mult) {
            int add = mult * fmul(fpow(n - k - i, n), fmul(fact[n - k], fmul(ifact(i), ifact(n - k - i))));
            while(add < 0) {
                add += fmod;
            }
            ans += add;
            if(ans >= fmod) {
                ans -= fmod;
            }
        }
        ans = fmul(fmul(ans, fact[n]), fmul(ifact(k), ifact(n - k)));
        prln(k == 0 ? ans : fmul(ans, 2));
        close();
    }

    static int[] ifact;

    static int ifact(int x) {
        if(ifact[x] > 0) {
            return ifact[x];
        } else {
            return ifact[x] = fpow(fact[x], fmod - 2);
        }
    }

    static int fmod = 998244353;

    static int fpow(int a, int b) {
        if(a == 0) {
            return 0;
        }
        int ans = 1;
        while(b > 0) {
            if((b & 1) > 0) {
                ans = fmul(ans, a);
            }
            a = fmul(a, a);
            b >>= 1;
        }
        return ans;
    }

    static int fmul(int a, int b) {
        return (int)((long)a * b % fmod);
    }

    /* static int fmul(int a, int b) {
        int ans = 0;
        while(b > 0) {
            if((b & 1) > 0) {
                ans += a;
                if(ans >= fmod) {
                    ans -= fmod;
                }
            }
            a <<= 1;
            if(a >= fmod) {
                a -= fmod;
            }
            b >>= 1;
        }
        return ans;
    } */

    static BufferedReader __in = new BufferedReader(new InputStreamReader(System.in));
    static PrintWriter __out = new PrintWriter(new OutputStreamWriter(System.out));
    static StringTokenizer input;
    static Random rand = new Random();

    // references
    // IBIG = 1e9 + 7
    // IMAX ~= 2e10
    // LMAX ~= 9e18

    // constants
    static final int IBIG = 1000000007;
    static final int IMAX = 2147483647;
    static final int IMIN = -2147483648;
    static final long LMAX = 9223372036854775807L;
    static final long LMIN = -9223372036854775808L;
    // math util
    static int minof(int a, int b, int c) {return min(a, min(b, c));}
    static int minof(int... x) {if(x.length == 1) return x[0]; if(x.length == 2) return min(x[0], x[1]); if(x.length == 3) return min(x[0], min(x[1], x[2])); int min = x[0]; for(int i = 1; i < x.length; ++i) if(x[i] < min) min = x[i]; return min;}
    static long minof(long a, long b, long c) {return min(a, min(b, c));}
    static long minof(long... x) {if(x.length == 1) return x[0]; if(x.length == 2) return min(x[0], x[1]); if(x.length == 3) return min(x[0], min(x[1], x[2])); long min = x[0]; for(int i = 1; i < x.length; ++i) if(x[i] < min) min = x[i]; return min;}
    static int maxof(int a, int b, int c) {return max(a, max(b, c));}
    static int maxof(int... x) {if(x.length == 1) return x[0]; if(x.length == 2) return max(x[0], x[1]); if(x.length == 3) return max(x[0], max(x[1], x[2])); int max = x[0]; for(int i = 1; i < x.length; ++i) if(x[i] > max) max = x[i]; return max;}
    static long maxof(long a, long b, long c) {return max(a, max(b, c));}
    static long maxof(long... x) {if(x.length == 1) return x[0]; if(x.length == 2) return max(x[0], x[1]); if(x.length == 3) return max(x[0], max(x[1], x[2])); long max = x[0]; for(int i = 1; i < x.length; ++i) if(x[i] > max) max = x[i]; return max;}
    static int powi(int a, int b) {if(a == 0) return 0; int ans = 1; while(b > 0) {if((b & 1) > 0) ans *= a; a *= a; b >>= 1;} return ans;}
    static long powl(long a, int b) {if(a == 0) return 0; long ans = 1; while(b > 0) {if((b & 1) > 0) ans *= a; a *= a; b >>= 1;} return ans;}
    static int fli(double d) {return (int)d;}
    static int cei(double d) {return (int)ceil(d);}
    static long fll(double d) {return (long)d;}
    static long cel(double d) {return (long)ceil(d);}
    static int randInt(int min, int max) {return rand.nextInt(max - min + 1) + min;}
    // array util
    static void reverse(int[] a) {for(int i = 0, n = a.length, half = n / 2; i < half; ++i) {int swap = a[i]; a[i] = a[n - i - 1]; a[n - i - 1] = swap;}}
    static void reverse(long[] a) {for(int i = 0, n = a.length, half = n / 2; i < half; ++i) {long swap = a[i]; a[i] = a[n - i - 1]; a[n - i - 1] = swap;}}
    static void reverse(char[] a) {for(int i = 0, n = a.length, half = n / 2; i < half; ++i) {char swap = a[i]; a[i] = a[n - i - 1]; a[n - i - 1] = swap;}}
    static void shuffle(int[] a) {int n = a.length - 1; for(int i = 0; i < n; ++i) {int ind = randInt(i, n); int swap = a[i]; a[i] = a[ind]; a[ind] = swap;}}
    static void shuffle(long[] a) {int n = a.length - 1; for(int i = 0; i < n; ++i) {int ind = randInt(i, n); long swap = a[i]; a[i] = a[ind]; a[ind] = swap;}}
    static void rsort(int[] a) {shuffle(a); sort(a);}
    static void rsort(long[] a) {shuffle(a); sort(a);}
    static int[] copy(int[] a) {int[] ans = new int[a.length]; for(int i = 0; i < a.length; ++i) ans[i] = a[i]; return ans;}
    static long[] copy(long[] a) {long[] ans = new long[a.length]; for(int i = 0; i < a.length; ++i) ans[i] = a[i]; return ans;}
    static char[] copy(char[] a) {char[] ans = new char[a.length]; for(int i = 0; i < a.length; ++i) ans[i] = a[i]; return ans;}
    static int[] sorted(int[] a) {int[] ans = copy(a); sort(ans); return ans;}
    static long[] sorted(long[] a) {long[] ans = copy(a); sort(ans); return ans;}
    static int[] rsorted(int[] a) {int[] ans = copy(a); rsort(ans); return ans;}
    static long[] rsorted(long[] a) {long[] ans = copy(a); rsort(ans); return ans;}
    // graph util
    static List<List<Integer>> graph(int n) {List<List<Integer>> g = new ArrayList<>(); for(int i = 0; i < n; ++i) g.add(new ArrayList<>()); return g;}
    static List<List<Integer>> graph(List<List<Integer>> g, int m) throws IOException {for(int i = 0; i < m; ++i) connect(g, rni() - 1, ni() - 1); return g;}
    static List<List<Integer>> graph(int n, int m) throws IOException {return graph(graph(n), m);}
    static List<List<Integer>> dgraph(List<List<Integer>> g, int m) throws IOException {for(int i = 0; i < m; ++i) connecto(g, rni() - 1, ni() - 1); return g;}
    static List<List<Integer>> dgraph(List<List<Integer>> g, int n, int m) throws IOException {return dgraph(graph(n), m);}
    static List<Set<Integer>> sgraph(int n) {List<Set<Integer>> g = new ArrayList<>(); for(int i = 0; i < n; ++i) g.add(new HashSet<>()); return g;}
    static List<Set<Integer>> sgraph(List<Set<Integer>> g, int m) throws IOException {for(int i = 0; i < m; ++i) connect(g, rni() - 1, ni() - 1); return g;}
    static List<Set<Integer>> sgraph(int n, int m) throws IOException {return sgraph(sgraph(n), m);}
    static List<Set<Integer>> dsgraph(List<Set<Integer>> g, int m) throws IOException {for(int i = 0; i < m; ++i) connecto(g, rni() - 1, ni() - 1); return g;}
    static List<Set<Integer>> dsgraph(List<Set<Integer>> g, int n, int m) throws IOException {return dsgraph(sgraph(n), m);}
    static void connect(List<? extends Collection<Integer>> g, int u, int v) {g.get(u).add(v); g.get(v).add(u);}
    static void connecto(List<? extends Collection<Integer>> g, int u, int v) {g.get(u).add(v);}
    static void dconnect(List<? extends Collection<Integer>> g, int u, int v) {g.get(u).remove(v); g.get(v).remove(u);}
    static void dconnecto(List<? extends Collection<Integer>> g, int u, int v) {g.get(u).remove(v);}
    // input
    static void r() throws IOException {input = new StringTokenizer(__in.readLine());}
    static int ri() throws IOException {return Integer.parseInt(__in.readLine());}
    static long rl() throws IOException {return Long.parseLong(__in.readLine());}
    static int[] ria(int n) throws IOException {int[] a = new int[n]; input = new StringTokenizer(__in.readLine()); for(int i = 0; i < n; ++i) a[i] = Integer.parseInt(input.nextToken()); return a;}
    static int[] riam1(int n) throws IOException {int[] a = new int[n]; input = new StringTokenizer(__in.readLine()); for(int i = 0; i < n; ++i) a[i] = Integer.parseInt(input.nextToken()) - 1; return a;}
    static long[] rla(int n) throws IOException {long[] a = new long[n]; input = new StringTokenizer(__in.readLine()); for(int i = 0; i < n; ++i) a[i] = Long.parseLong(input.nextToken()); return a;}
    static char[] rcha() throws IOException {return __in.readLine().toCharArray();}
    static String rline() throws IOException {return __in.readLine();}
    static int rni() throws IOException {input = new StringTokenizer(__in.readLine()); return Integer.parseInt(input.nextToken());}
    static int ni() {return Integer.parseInt(input.nextToken());}
    static long rnl() throws IOException {input = new StringTokenizer(__in.readLine()); return Long.parseLong(input.nextToken());}
    static long nl() {return Long.parseLong(input.nextToken());}
    // output
    static void pr(int i) {__out.print(i);}
    static void prln(int i) {__out.println(i);}
    static void pr(long l) {__out.print(l);}
    static void prln(long l) {__out.println(l);}
    static void pr(double d) {__out.print(d);}
    static void prln(double d) {__out.println(d);}
    static void pr(char c) {__out.print(c);}
    static void prln(char c) {__out.println(c);}
    static void pr(char[] s) {__out.print(new String(s));}
    static void prln(char[] s) {__out.println(new String(s));}
    static void pr(String s) {__out.print(s);}
    static void prln(String s) {__out.println(s);}
    static void pr(Object o) {__out.print(o);}
    static void prln(Object o) {__out.println(o);}
    static void prln() {__out.println();}
    static void pryes() {__out.println("yes");}
    static void pry() {__out.println("Yes");}
    static void prY() {__out.println("YES");}
    static void prno() {__out.println("no");}
    static void prn() {__out.println("No");}
    static void prN() {__out.println("NO");}
    static void pryesno(boolean b) {__out.println(b ? "yes" : "no");};
    static void pryn(boolean b) {__out.println(b ? "Yes" : "No");}
    static void prYN(boolean b) {__out.println(b ? "YES" : "NO");}
    static void prln(int... a) {for(int i = 0, len = a.length - 1; i < len; __out.print(a[i]), __out.print(' '), ++i); __out.println(a[a.length - 1]);}
    static void prln(long... a) {for(int i = 0, len = a.length - 1; i < len; __out.print(a[i]), __out.print(' '), ++i); __out.println(a[a.length - 1]);}
    static <T> void prln(Collection<T> c) {int n = c.size() - 1; Iterator<T> iter = c.iterator(); for(int i = 0; i < n; __out.print(iter.next()), __out.print(' '), ++i); if(n >= 0) __out.println(iter.next()); else __out.println();}
    static void h() {__out.println("hlfd");}
    static void flush() {__out.flush();}
    static void close() {__out.close();}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Queue;
import java.util.StringTokenizer;
import java.util.TreeSet;

import javax.swing.*;

import static java.util.Arrays.binarySearch;
import static java.util.Arrays.copyOfRange;
import static java.util.Arrays.sort;

public class Main {

    public static void main(String[] args) throws Exception {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;

        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);

        Task solver = new Task();
        solver.solve(1, in, out);
        out.close();
    }
}

class Task {

    private static int mod = 998244353;

    public long powMod(long a, long b) {
        long ans = 1, d = a;
        while (b > 0) {
            if (b % 2 == 1) ans = ans * d % mod;
            b >>= 1;
            d = d * d % mod;
        }
        return ans;
    }

    long[] fac, inv;

    public void solve(int testNumber, InputReader in, PrintWriter out) {
        //int T = in.nextInt();
        int n = 200001;
        fac = new long[n];
        inv = new long[n];
        fac[0] = inv[0] = 1;
        for (int i = 1; i < n; i++) {
            fac[i] = fac[i - 1] * i % mod;
            inv[i] = inv[i - 1] * powMod(i, mod - 2) % mod;
        }
        //for (int tc = 1; tc <= T; tc++) {
            n = in.nextInt();
            long k = in.nextLong();
            if (k >= n) {
                out.println(0);
                return;
            }
            if (k == 0) {
                out.println(fac[n]);
                return;
            }
            int m = (int)(n - k);
            long ans = 0;
            for (int i = 0; i <= m; i++) {
                if (i % 2 == 0) {
                    ans = (ans + getC(m, i) * powMod(m - i, n) % mod) % mod;
                } else {
                    ans = ((ans - getC(m, i) * powMod(m - i, n) % mod) % mod + mod) % mod;
                }
            }
            out.println(2 * fac[n] * inv[n - m] % mod * ans % mod * inv[m] % mod);
        //}
    }

    private long getC(int n, int m) {
        return fac[n] * inv[m] % mod * inv[n - m] % mod;
    }

}

class InputReader {

    private final BufferedReader reader;
    private StringTokenizer tokenizer;

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

    public String nextLine() {
        try {
            return reader.readLine();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            tokenizer = new StringTokenizer(nextLine());
        }
        return tokenizer.nextToken();
    }

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

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

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

}


import java.util.*;
import java.io.*;
public class EdE {

	public static void main(String[] args) throws Exception{
		int num = 998244353;

		// TODO Auto-generated method stub
 		BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
 		PrintWriter out = new PrintWriter(System.out);
 		StringTokenizer st = new StringTokenizer(bf.readLine());
 		long n = Long.parseLong(st.nextToken());
 		long k = Long.parseLong(st.nextToken());
 		long[] fact = new long[200001];
 		fact[0] = 1;
 		long ans1 = 1;
 		for(int i = 1;i<=200000;i++){
 			ans1= (ans1*i) % num;
 			fact[i] = ans1;
 		}
 		long ans = 0;
 		for (int i = 0;i<n-k;i++){
 			//ans+= (-1)^i*(n-k choose i)* (n-k-i)^n
 			long ks = 1;
			ks = ks * fact[(int)(n-k)]%num;
			ks = ks*power(fact[i], num-2, num)%num;
			ks = ks*power(fact[(int)(n-k-i)], num-2, num)%num;
 			if (i%2 == 0){

 				ans+= ks * power(n-k-i, n, num)%num;
 			}
 			else{
 				ans-= ks* power(n-k-i, n, num)%num;
 			}
 			ans = ans%num;
 		}
 		if (k >=n)
 			out.println(0);
 		else{
 		if (k != 0)
 			ans= ans*2%num;

 		ans = ans*fact[(int)(n)]%num;
 		ans = ans*power(fact[(int)(k)], num-2, num)%num;
 		ans = ans*power(fact[(int)(n-k)], num-2, num)%num;

 		while (ans < 0){
 			ans = ans+num;
 		}
 		out.println(ans);
 		}
 		out.close();

 	}

	public static int power(long x, long y, long mod){
		long ans = 1;
		while(y>0){
			if (y%2==1)
				ans = (ans*x)%mod;
			x = (x*x)%mod;
			y/=2;
		}
		return (int)(ans);
	}
 }

//StringJoiner sj = new StringJoiner(" ");
//sj.add(strings)
//sj.toString() gives string of those stuff w spaces or whatever that sequence is


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

public class Main{
	static int mod=998244353;
	static long fastpow(long n,long ti) {
		 if (ti == 0)
		        return 1l;
		if(ti%2==0) {
			long y=fastpow(n, ti/2);
			long k=y*y;
			k%=mod;
			return k;
		}
		else {
			long y=fastpow(n, ti/2);
			long k=((n*y)%mod)*y;
			k%=mod;
			return k;
		}
	}
	static long[]fac;

	public static long ncr(int n,int k) {
		if(n<k)return 0;
		long num=fac[(n)];
		long den=(fac[(n-k)]*fac[k])%mod;
		long ans=(num*fastpow(den,mod-2));
		return ans%mod;
	}
	public static void main(String[] args) throws Exception{
		PrintWriter pw=new PrintWriter(System.out);
		MScanner sc = new MScanner(System.in);
		fac=new long[(int)2e5+1];
		fac[0]=1;for(int i=1;i<fac.length;i++)fac[i]=(fac[i-1]*i)%mod;

		int n=sc.nextInt();long k=sc.nextLong();
		if(k>=n) {
			pw.println(0);
			pw.flush();
			return;
		}
		if(k==0) {
			pw.println(fac[(int)n]);
			pw.flush();
			return;
		}
		if(k==n-1) {
			pw.println(2*n);
			pw.flush();
			return;
		}
		//columns to fill with one rook
		int filledCols=(int)(n-k);

		long waysToChooseFilledCols=ncr(n, filledCols);

		long ans=0;

		for(int emptyCols=0;emptyCols<=filledCols;emptyCols++) {
			long waysToChoose=ncr(filledCols, emptyCols);
			long waysToFill=fastpow(filledCols-emptyCols, n);
			long val=(waysToChoose*waysToFill)%mod;

			if(emptyCols%2==1) {
				val*=-1;
			}
			ans=(ans+val+mod)%mod;
		}
		ans=(ans*waysToChooseFilledCols)%mod;

		//the same for rows
		ans=(ans*2)%mod;

		pw.println(ans);
		pw.flush();
	}
	static class MScanner {
		StringTokenizer st;
		BufferedReader br;
		public MScanner(InputStream system) {
			br = new BufferedReader(new InputStreamReader(system));
		}

		public MScanner(String file) throws Exception {
			br = new BufferedReader(new FileReader(file));
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}
		public int[] intArr(int n) throws IOException {
	        int[]in=new int[n];for(int i=0;i<n;i++)in[i]=nextInt();
	        return in;
		}
		public long[] longArr(int n) throws IOException {
	        long[]in=new long[n];for(int i=0;i<n;i++)in[i]=nextLong();
	        return in;
		}
		public int[] intSortedArr(int n) throws IOException {
	        int[]in=new int[n];for(int i=0;i<n;i++)in[i]=nextInt();
	        shuffle(in);
	        Arrays.sort(in);
	        return in;
		}
		public long[] longSortedArr(int n) throws IOException {
	        long[]in=new long[n];for(int i=0;i<n;i++)in[i]=nextLong();
	        shuffle(in);
	        Arrays.sort(in);
	        return in;
		}
		public Integer[] IntegerArr(int n) throws IOException {
	        Integer[]in=new Integer[n];for(int i=0;i<n;i++)in[i]=nextInt();
	        return in;
		}
		public Long[] LongArr(int n) throws IOException {
	        Long[]in=new Long[n];for(int i=0;i<n;i++)in[i]=nextLong();
	        return in;
		}
		public String nextLine() throws IOException {
			return br.readLine();
		}

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

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

		public char nextChar() throws IOException {
			return next().charAt(0);
		}

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

		public boolean ready() throws IOException {
			return br.ready();
		}

		public void waitForInput() throws InterruptedException {
			Thread.sleep(3000);
		}
	}
	static void shuffle(int[]in) {
		for(int i=0;i<in.length;i++) {
			int idx=(int)(Math.random()*in.length);
			int tmp=in[i];
			in[i]=in[idx];
			in[idx]=tmp;
		}
	}
	static void shuffle(long[]in) {
		for(int i=0;i<in.length;i++) {
			int idx=(int)(Math.random()*in.length);
			long tmp=in[i];
			in[i]=in[idx];
			in[idx]=tmp;
		}
	}
	static String arrToString(int[]x) {
		return Arrays.toString(x);
	}
	static String arrToString(long[]x) {
		return Arrays.toString(x);
	}
	static String arrToString(Integer[]x) {
		return Arrays.toString(x);
	}
	static String arrToString(Long[]x) {
		return Arrays.toString(x);
	}
}


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

public class Main {
	static final long MOD = 998244353L;
	//static final long INF = 1000000000000000007L;
	//static final long MOD = 1000000007L;
	//static final int INF = 1000000007;

	static long[] fac;
	public static void main(String[] args) {
		FastScanner sc = new FastScanner();
		PrintWriter pw = new PrintWriter(System.out);

		int N = sc.ni();
		long K = sc.nl();
		if (K >= N) {
			pw.println(0);
			pw.close();
			return;
		}
		int C = (int)(N-K);

		fac = new long[200001];
		fac[0] = 1L;
		for (int i = 1; i <= 200000; i++)
			fac[i] = (i*fac[i-1])%MOD;

		long ans = 0;
		int sign = 1;
		for (int i = C; i > 0; i--) {
			long val = (choose(C,i)*power(i,N,MOD))%MOD;
			ans += sign*val;
			ans += 2*MOD;
			ans %= MOD;
			sign *= -1;
		}

		long mult = 2*choose(N,C);
		if (C==N)
			mult = 1L;
		pw.println((ans*mult)%MOD);

		pw.close();
	}

	public static long choose(int n, int k) {
		long den = (fac[k]*fac[n-k])%MOD;
		long denInv = power(den,MOD-2,MOD);
		long ans = (fac[n]*denInv)%MOD;
		return ans;
	}

	public static long dist(long[] p1, long[] p2) {
		return (Math.abs(p2[0]-p1[0])+Math.abs(p2[1]-p1[1]));
	}

	//Find the GCD of two numbers
	public static long gcd(long a, long b) {
		if (a < b) return gcd(b,a);
		if (b == 0)
			return a;
		else
			return gcd(b,a%b);
	}

	//Fast exponentiation (x^y mod m)
	public static long power(long x, long y, long m) {
		if (y < 0) return 0L;
		long ans = 1;
		x %= m;
		while (y > 0) {
			if(y % 2 == 1)
				ans = (ans * x) % m;
			y /= 2;
			x = (x * x) % m;
		}
		return ans;
	}

	public static int[] shuffle(int[] array) {
		Random rgen = new Random();
		for (int i = 0; i < array.length; i++) {
		    int randomPosition = rgen.nextInt(array.length);
		    int temp = array[i];
		    array[i] = array[randomPosition];
		    array[randomPosition] = temp;
		}
		return array;
	}

	public static long[] shuffle(long[] array) {
		Random rgen = new Random();
		for (int i = 0; i < array.length; i++) {
		    int randomPosition = rgen.nextInt(array.length);
		    long temp = array[i];
		    array[i] = array[randomPosition];
		    array[randomPosition] = temp;
		}
		return array;
	}

	public static int[][] shuffle(int[][] array) {
		Random rgen = new Random();
		for (int i = 0; i < array.length; i++) {
		    int randomPosition = rgen.nextInt(array.length);
		    int[] temp = array[i];
		    array[i] = array[randomPosition];
		    array[randomPosition] = temp;
		}
		return array;
	}

    public static int[][] sort(int[][] array) {
    	//Sort an array (immune to quicksort TLE)

		Arrays.sort(array, new Comparator<int[]>() {
			  @Override
        	  public int compare(int[] a, int[] b) {
				  return a[0]-b[0]; //ascending order
	          }
		});
		return array;
	}

    public static long[][] sort(long[][] array) {
    	//Sort an array (immune to quicksort TLE)
		Random rgen = new Random();
		for (int i = 0; i < array.length; i++) {
		    int randomPosition = rgen.nextInt(array.length);
		    long[] temp = array[i];
		    array[i] = array[randomPosition];
		    array[randomPosition] = temp;
		}
		Arrays.sort(array, new Comparator<long[]>() {
			  @Override
        	  public int compare(long[] a, long[] b) {
				  if (a[0] < b[0])
					  return -1;
				  else if (a[0] > b[0])
					  return 1;
				  else
					  return 0;
	          }
		});
		return array;
	}

    static class FastScanner {
        BufferedReader br;
        StringTokenizer st;

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

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

        int ni() {
            return Integer.parseInt(next());
        }

        long nl() {
            return Long.parseLong(next());
        }

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

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
}


import java.io.*;
import java.util.*;
import static java.lang.System.out;

public class Solution{
    private static class Scan{
        StringTokenizer str;
        BufferedReader br;
        Scan() {
            br = new BufferedReader(new InputStreamReader(System.in));
            str = null;
        }
        Scan(InputStream x)
        {
            br=new BufferedReader(new InputStreamReader(x));
            str=null;
        }
        String next()
        {
            while(str==null||!str.hasMoreElements()){
                try{
                    str=new StringTokenizer(br.readLine());
                }catch (Exception e){
                    out.println(e);
                }
            }
            return str.nextToken();
        }
        int nextInt()
        {
            return Integer.parseInt(next());
        }
        long nextLong()
        {
            return  Long.parseLong(next());
        }
        double nextDouble()
        {
            return Double.parseDouble(next());
        }
        String nextLine()
        {
            try {
                if (str == null || !str.hasMoreElements())str=new StringTokenizer(br.readLine());
            }catch (IOException e){
                out.println(e);
            }
            return str.nextToken("\n");
        }
    }
    static long MOD=998244353L;
    static int asz=200005;
    static long BigMod(long a,long b,long m){
        if(b==0)return 1L;
        if(b%2==1)return a*BigMod(a,b-1,m)%m;
        return BigMod(a*a%m,b/2,m)%m;
    }
    static long f[]=new long[asz];
    static long C(int n,int k){
        if(k>n)return 0L;
        return f[n]*BigMod(f[k],MOD-2,MOD)%MOD*BigMod(f[n-k],MOD-2,MOD)%MOD;
    }
    static long solve(int n,int k){
        long ans=0;
        for(int i=0;i<=n-k;i++){
            if(i%2==0)ans=(ans+C(n-k,i)*BigMod(n-k-i,n,MOD)%MOD)%MOD;
            else ans=(ans-C(n-k,i)*BigMod(n-k-i,n,MOD)%MOD+MOD)%MOD;
        }
        return ans;
    }
    public static void main(String[] args){
        Scan in=new Scan();
        int t=1;
        //t=in.nextInt();
        for(int qq=1;qq<=t;qq++){
            long n,k;
            n=in.nextLong();
            k=in.nextLong();
            f[0]=1;
            for(long i=1;i<=n;i++)f[(int)i]=f[(int)(i-1)]*i%MOD;
            if(k>=n)out.println(0);
            else if(k==0)out.println(f[(int)n]);
            else{
                out.println(2*C((int)n,(int)(n-k))*solve((int)n,(int)k)%MOD);
            }
        }
    }
}


//package ecr086;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;

public class E {
	InputStream is;
	PrintWriter out;
	String INPUT = "";

	void solve()
	{
		int mod = 998244353;
		int n = ni();
		long K = nl();
		if(K >= n){
			out.println(0);
			return;
		}
		int[][] fif = enumFIF(250000, mod);
		if(K == 0){
			out.println(fif[0][n]);
			return;
		}

		long ans = 0;
		for(int i = (int)(n-K), s = 1;i >= 1;i--, s = mod - s){
			ans += C(n, i, mod, fif) * pow(i, n, mod) % mod * s % mod * C((int)(n-i), (int)K, mod, fif);
			ans %= mod;
		}
		ans = ans * 2 % mod;
		out.println(ans);
	}

	public static long pow(long a, long n, long mod) {
		//		a %= mod;
		long ret = 1;
		int x = 63 - Long.numberOfLeadingZeros(n);
		for (; x >= 0; x--) {
			ret = ret * ret % mod;
			if (n << 63 - x < 0)
				ret = ret * a % mod;
		}
		return ret;
	}

	public static long C(int n, int r, int mod, int[][] fif) {
		if (n < 0 || r < 0 || r > n)
			return 0;
		return (long) fif[0][n] * fif[1][r] % mod * fif[1][n - r] % mod;
	}

	public static int[][] enumFIF(int n, int mod) {
		int[] f = new int[n + 1];
		int[] invf = new int[n + 1];
		f[0] = 1;
		for (int i = 1; i <= n; i++) {
			f[i] = (int) ((long) f[i - 1] * i % mod);
		}
		long a = f[n];
		long b = mod;
		long p = 1, q = 0;
		while (b > 0) {
			long c = a / b;
			long d;
			d = a;
			a = b;
			b = d % b;
			d = p;
			p = q;
			q = d - c * q;
		}
		invf[n] = (int) (p < 0 ? p + mod : p);
		for (int i = n - 1; i >= 0; i--) {
			invf[i] = (int) ((long) invf[i + 1] * (i + 1) % mod);
		}
		return new int[][] { f, invf };
	}

	void run() throws Exception
	{
		is = oj ? System.in : new ByteArrayInputStream(INPUT.getBytes());
		out = new PrintWriter(System.out);

		long s = System.currentTimeMillis();
		solve();
		out.flush();
		tr(System.currentTimeMillis()-s+"ms");
	}

	public static void main(String[] args) throws Exception { new E().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(!oj)System.out.println(Arrays.deepToString(o)); }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.IOException;
import java.io.UncheckedIOException;
import java.io.Closeable;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.io.InputStream;

/**
 * @author khokharnikunj8
 */
public class Main {
    public static void main(String[] args) throws Exception {
        Thread thread = new Thread(null, new TaskAdapter(), "khokharnikunj8", 1 << 27);
        thread.start();
        thread.join();
    }

    static class TaskAdapter implements Runnable {
        @Override
        public void run() {
            InputStream inputStream = System.in;
            OutputStream outputStream = System.out;
            FastInput in = new FastInput(inputStream);
            FastOutput out = new FastOutput(outputStream);
            EPlacingRooks solver = new EPlacingRooks();
            solver.solve(1, in, out);
            out.close();
        }
    }

    static class EPlacingRooks {
        Modular md = new Modular(998244353);
        Power pw = new Power(md);
        Combination cb = new Combination(1000000, md);

        public void solve(int testNumber, FastInput in, FastOutput out) {
            int n = in.readInt();
            long kk = in.readLong();
            if (kk >= n) {
                out.println(0);
                return;
            }
            int k = (int) kk;
            long ans = 0;
            for (int i = 0; i < (n - k); i++) {
                if (i % 2 == 0) ans = md.plus(ans, md.mul(cb.composite((n - k), i), pw.pow(n - k - i, n)));
                else ans = md.subtract(ans, md.mul(cb.composite(n - k, i), pw.pow(n - k - i, n)));
            }
            ans = md.mul(ans, cb.invFact(n - k));
            ans = md.mul(ans, cb.fact(n - k));
            ans = md.mul(ans, cb.composite(n, n - k));
            if (k != 0) out.println(md.mul(ans, 2));
            else out.println(ans);
        }

    }

    static class InverseNumber {
        int[] inv;

        public InverseNumber(int[] inv, int limit, Modular modular) {
            this.inv = inv;
            inv[1] = 1;
            int p = modular.getMod();
            for (int i = 2; i <= limit; i++) {
                int k = p / i;
                int r = p % i;
                inv[i] = modular.mul(-k, inv[r]);
            }
        }

        public InverseNumber(int limit, Modular modular) {
            this(new int[limit + 1], limit, modular);
        }

    }

    static class Modular {
        int m;

        public int getMod() {
            return m;
        }

        public Modular(int m) {
            this.m = m;
        }

        public Modular(long m) {
            this.m = (int) m;
            if (this.m != m) {
                throw new IllegalArgumentException();
            }
        }

        public Modular(double m) {
            this.m = (int) m;
            if (this.m != m) {
                throw new IllegalArgumentException();
            }
        }

        public int valueOf(int x) {
            x %= m;
            if (x < 0) {
                x += m;
            }
            return x;
        }

        public int valueOf(long x) {
            x %= m;
            if (x < 0) {
                x += m;
            }
            return (int) x;
        }

        public int mul(int x, int y) {
            return valueOf((long) x * y);
        }

        public int mul(long x, long y) {
            return valueOf(x * y);
        }

        public int plus(long x, long y) {
            return valueOf(x + y);
        }

        public int subtract(long x, long y) {
            return valueOf(x - y);
        }

        public String toString() {
            return "mod " + m;
        }

    }

    static class Combination {
        final Factorial factorial;
        final Modular modular;

        public Combination(Factorial factorial) {
            this.factorial = factorial;
            this.modular = factorial.getModular();
        }

        public Combination(int limit, Modular modular) {
            this(new Factorial(limit, modular));
        }

        public int composite(int m, int n) {
            if (n > m) {
                return 0;
            }
            return modular.mul(modular.mul(factorial.fact(m), factorial.invFact(n)), factorial.invFact(m - n));
        }

        public int fact(int x) {
            return factorial.fact(x);
        }

        public int invFact(int x) {
            return factorial.invFact(x);
        }

    }

    static class FastOutput implements AutoCloseable, Closeable, Appendable {
        private StringBuilder cache = new StringBuilder(1 << 20);
        private final Writer os;

        public FastOutput append(CharSequence csq) {
            cache.append(csq);
            return this;
        }

        public FastOutput append(CharSequence csq, int start, int end) {
            cache.append(csq, start, end);
            return this;
        }

        public FastOutput(Writer os) {
            this.os = os;
        }

        public FastOutput(OutputStream os) {
            this(new OutputStreamWriter(os));
        }

        public FastOutput append(char c) {
            cache.append(c);
            return this;
        }

        public FastOutput append(int c) {
            cache.append(c);
            return this;
        }

        public FastOutput append(long c) {
            cache.append(c);
            return this;
        }

        public FastOutput println(int c) {
            return append(c).println();
        }

        public FastOutput println(long c) {
            return append(c).println();
        }

        public FastOutput println() {
            cache.append(System.lineSeparator());
            return this;
        }

        public FastOutput flush() {
            try {
                os.append(cache);
                os.flush();
                cache.setLength(0);
            } catch (IOException e) {
                throw new UncheckedIOException(e);
            }
            return this;
        }

        public void close() {
            flush();
            try {
                os.close();
            } catch (IOException e) {
                throw new UncheckedIOException(e);
            }
        }

        public String toString() {
            return cache.toString();
        }

    }

    static class Power {
        final Modular modular;

        public Power(Modular modular) {
            this.modular = modular;
        }

        public int pow(int x, int n) {
            if (n == 0) {
                return modular.valueOf(1);
            }
            long r = pow(x, n >> 1);
            r = modular.valueOf(r * r);
            if ((n & 1) == 1) {
                r = modular.valueOf(r * x);
            }
            return (int) r;
        }

    }

    static class Factorial {
        int[] fact;
        int[] inv;
        Modular modular;

        public Modular getModular() {
            return modular;
        }

        public Factorial(int[] fact, int[] inv, InverseNumber in, int limit, Modular modular) {
            this.modular = modular;
            this.fact = fact;
            this.inv = inv;
            fact[0] = inv[0] = 1;
            for (int i = 1; i <= limit; i++) {
                fact[i] = modular.mul(fact[i - 1], i);
                inv[i] = modular.mul(inv[i - 1], in.inv[i]);
            }
        }

        public Factorial(int limit, Modular modular) {
            this(new int[limit + 1], new int[limit + 1], new InverseNumber(limit, modular), limit, modular);
        }

        public int fact(int n) {
            return fact[n];
        }

        public int invFact(int n) {
            return inv[n];
        }

    }

    static class FastInput {
        private final InputStream is;
        private byte[] buf = new byte[1 << 20];
        private int bufLen;
        private int bufOffset;
        private int next;

        public FastInput(InputStream is) {
            this.is = is;
        }

        private int read() {
            while (bufLen == bufOffset) {
                bufOffset = 0;
                try {
                    bufLen = is.read(buf);
                } catch (IOException e) {
                    bufLen = -1;
                }
                if (bufLen == -1) {
                    return -1;
                }
            }
            return buf[bufOffset++];
        }

        public void skipBlank() {
            while (next >= 0 && next <= 32) {
                next = read();
            }
        }

        public int readInt() {
            int sign = 1;

            skipBlank();
            if (next == '+' || next == '-') {
                sign = next == '+' ? 1 : -1;
                next = read();
            }

            int val = 0;
            if (sign == 1) {
                while (next >= '0' && next <= '9') {
                    val = val * 10 + next - '0';
                    next = read();
                }
            } else {
                while (next >= '0' && next <= '9') {
                    val = val * 10 - next + '0';
                    next = read();
                }
            }

            return val;
        }

        public long readLong() {
            int sign = 1;

            skipBlank();
            if (next == '+' || next == '-') {
                sign = next == '+' ? 1 : -1;
                next = read();
            }

            long val = 0;
            if (sign == 1) {
                while (next >= '0' && next <= '9') {
                    val = val * 10 + next - '0';
                    next = read();
                }
            } else {
                while (next >= '0' && next <= '9') {
                    val = val * 10 - next + '0';
                    next = read();
                }
            }

            return val;
        }

    }
}


    import java.io.OutputStream;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.io.IOException;
    import java.io.UncheckedIOException;
    import java.io.Closeable;
    import java.io.Writer;
    import java.io.OutputStreamWriter;
    import java.io.InputStream;

    /**
     * Built using CHelper plug-in
     * Actual solution is at the top
     */
    public class Main {
        public static void main(String[] args) throws Exception {
            Thread thread = new Thread(null, new TaskAdapter(), "", 1 << 27);
            thread.start();
            thread.join();
        }

        static class TaskAdapter implements Runnable {
            @Override
            public void run() {
                InputStream inputStream = System.in;
                OutputStream outputStream = System.out;
                FastInput in = new FastInput(inputStream);
                FastOutput out = new FastOutput(outputStream);
                EPlacingRooks solver = new EPlacingRooks();
                solver.solve(1, in, out);
                out.close();
            }
        }

        static class EPlacingRooks {
            public void solve(int testNumber, FastInput in, FastOutput out) {
                int n = in.readInt();
                int k = in.readInt();
                Modular mod = new Modular(998244353);
                int m = n - k;

                if (k == 0) {
                    int ans = 1;
                    for (int i = 1; i <= n; i++) {
                        ans = mod.mul(ans, i);
                    }
                    out.println(ans);
                    return;
                }
                if (m <= 0 || m > n) {
                    out.println(0);
                    return;
                }

                PrimeCombination combination = new PrimeCombination(n, mod);
                Power power = new Power(mod);
                int ans = 0;
                for (int i = 0; i <= m; i++) {
                    int local = combination.combination(m, i);
                    if (i % 2 == 1) {
                        local = mod.valueOf(-local);
                    }
                    local = mod.mul(local, power.pow(m - i, n));
                    ans = mod.plus(ans, local);
                }
                ans = mod.mul(ans, combination.combination(n, m));

                ans = mod.mul(ans, 2);
                out.println(ans);
            }

        }

        static interface IntCombination {
        }

        static class FastOutput implements AutoCloseable, Closeable, Appendable {
            private StringBuilder cache = new StringBuilder(10 << 20);
            private final Writer os;

            public FastOutput append(CharSequence csq) {
                cache.append(csq);
                return this;
            }

            public FastOutput append(CharSequence csq, int start, int end) {
                cache.append(csq, start, end);
                return this;
            }

            public FastOutput(Writer os) {
                this.os = os;
            }

            public FastOutput(OutputStream os) {
                this(new OutputStreamWriter(os));
            }

            public FastOutput append(char c) {
                cache.append(c);
                return this;
            }

            public FastOutput append(int c) {
                cache.append(c);
                return this;
            }

            public FastOutput println(int c) {
                return append(c).println();
            }

            public FastOutput println() {
                cache.append(System.lineSeparator());
                return this;
            }

            public FastOutput flush() {
                try {
                    os.append(cache);
                    os.flush();
                    cache.setLength(0);
                } catch (IOException e) {
                    throw new UncheckedIOException(e);
                }
                return this;
            }

            public void close() {
                flush();
                try {
                    os.close();
                } catch (IOException e) {
                    throw new UncheckedIOException(e);
                }
            }

            public String toString() {
                return cache.toString();
            }

        }

        static class InverseNumber {
            int[] inv;

            public InverseNumber(int[] inv, int limit, Modular modular) {
                this.inv = inv;
                inv[1] = 1;
                int p = modular.getMod();
                for (int i = 2; i <= limit; i++) {
                    int k = p / i;
                    int r = p % i;
                    inv[i] = modular.mul(-k, inv[r]);
                }
            }

            public InverseNumber(int limit, Modular modular) {
                this(new int[limit + 1], limit, modular);
            }

        }

        static class FastInput {
            private final InputStream is;
            private byte[] buf = new byte[1 << 20];
            private int bufLen;
            private int bufOffset;
            private int next;

            public FastInput(InputStream is) {
                this.is = is;
            }

            private int read() {
                while (bufLen == bufOffset) {
                    bufOffset = 0;
                    try {
                        bufLen = is.read(buf);
                    } catch (IOException e) {
                        bufLen = -1;
                    }
                    if (bufLen == -1) {
                        return -1;
                    }
                }
                return buf[bufOffset++];
            }

            public void skipBlank() {
                while (next >= 0 && next <= 32) {
                    next = read();
                }
            }

            public int readInt() {
                int sign = 1;

                skipBlank();
                if (next == '+' || next == '-') {
                    sign = next == '+' ? 1 : -1;
                    next = read();
                }

                int val = 0;
                if (sign == 1) {
                    while (next >= '0' && next <= '9') {
                        val = val * 10 + next - '0';
                        next = read();
                    }
                } else {
                    while (next >= '0' && next <= '9') {
                        val = val * 10 - next + '0';
                        next = read();
                    }
                }

                return val;
            }

        }

        static class PrimeCombination implements IntCombination {
            final Factorial factorial;
            final Modular modular;

            public PrimeCombination(Factorial factorial) {
                this.factorial = factorial;
                this.modular = factorial.getModular();
            }

            public PrimeCombination(int limit, Modular modular) {
                this(new Factorial(limit, modular));
            }

            public int combination(int m, int n) {
                if (n > m) {
                    return 0;
                }
                return modular.mul(modular.mul(factorial.fact(m), factorial.invFact(n)), factorial.invFact(m - n));
            }

        }

        static class Modular {
            int m;

            public int getMod() {
                return m;
            }

            public Modular(int m) {
                this.m = m;
            }

            public Modular(long m) {
                this.m = (int) m;
                if (this.m != m) {
                    throw new IllegalArgumentException();
                }
            }

            public Modular(double m) {
                this.m = (int) m;
                if (this.m != m) {
                    throw new IllegalArgumentException();
                }
            }

            public int valueOf(int x) {
                x %= m;
                if (x < 0) {
                    x += m;
                }
                return x;
            }

            public int valueOf(long x) {
                x %= m;
                if (x < 0) {
                    x += m;
                }
                return (int) x;
            }

            public int mul(int x, int y) {
                return valueOf((long) x * y);
            }

            public int plus(int x, int y) {
                return valueOf(x + y);
            }

            public String toString() {
                return "mod " + m;
            }

        }

        static class Factorial {
            int[] fact;
            int[] inv;
            Modular modular;

            public Modular getModular() {
                return modular;
            }

            public Factorial(int[] fact, int[] inv, InverseNumber in, int limit, Modular modular) {
                this.modular = modular;
                this.fact = fact;
                this.inv = inv;
                fact[0] = inv[0] = 1;
                for (int i = 1; i <= limit; i++) {
                    fact[i] = modular.mul(fact[i - 1], i);
                    inv[i] = modular.mul(inv[i - 1], in.inv[i]);
                }
            }

            public Factorial(int limit, Modular modular) {
                this(new int[limit + 1], new int[limit + 1], new InverseNumber(limit, modular), limit, modular);
            }

            public int fact(int n) {
                return fact[n];
            }

            public int invFact(int n) {
                return inv[n];
            }

        }

        static class Power {
            final Modular modular;

            public Power(Modular modular) {
                this.modular = modular;
            }

            public int pow(int x, int n) {
                if (n == 0) {
                    return modular.valueOf(1);
                }
                long r = pow(x, n >> 1);
                r = modular.valueOf(r * r);
                if ((n & 1) == 1) {
                    r = modular.valueOf(r * x);
                }
                return (int) r;
            }

        }
    }