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