#include <bits/stdc++.h>
int main() {
  long long n, k;
  scanf("%lld %lld", &n, &k);
  if (n % 2 == 0) {
    if (k <= n / 2)
      printf("%lld\n", 1 + 2 * (k - 1));
    else
      printf("%lld\n", 2 * (k - n / 2));
  } else {
    if (k <= n / 2 + 1)
      printf("%lld\n", 1 + 2 * (k - 1));
    else
      printf("%lld\n", 2 * (k - n / 2 - 1));
  }
  return 0;
}
