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