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