n, l = map(int, input().split()) q, r = divmod(n, l) m = q+r mod = 998244353 ans = pow(2, m, mod)-1 print(ans%mod)