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