#include <bits/stdc++.h>
using namespace std;
int Search(vector<long long int> v1, long long int x1) {
  long long int j;
  for (j = 0; j < v1.size(); j++) {
    if (x1 == v1[j]) {
      return 1;
    } else {
      continue;
    }
  }
  return -1;
}
int Search2(long long int v[], long long int x, long long int n) {
  long long int i;
  for (i = 0; i < n; i++) {
    if (x == v[i]) {
      return 1;
    } else {
      continue;
    }
  }
  return -1;
}
int main() {
  long long int i, e, r, g, pts, y, t, d, q, x, n, h, m, w, l, k,
      cnt = 500, countA = 0, sum, sumt, countB = 0, countC = 0, a1, a2,
      countD = 0;
  long long int min = 1000;
  vector<long long int> v3;
  vector<long long int> v2;
  set<long long int> s;
  cin >> n >> k;
  long long int a[n], b[2 * n], c[n];
  if (k <= n / 2 + n % 2)
    cout << 2 * (k - 1) + 1;
  else
    cout << 2 * (k - n / 2 - n % 2);
  return 0;
}
