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