#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k;
  cin >> n >> k;
  if (n % 2 == 0) {
    if (k > n / 2)
      cout << (k - (n / 2)) * 2;
    else
      cout << 2 * k - 1;
  } else {
    long long e = (n - 1) / 2;
    long long o = (n + 1) / 2;
    if (k > o)
      cout << (k - o) * 2;
    else
      cout << 2 * k - 1;
  }
}
