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