import java.util.Scanner; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int k = sc.nextInt(); sc.close(); if (n < k) { System.out.println("INF"); return; } int ans = 0; for (int i = n; i <= n + k; i++) { for (int j = i; j <= n + k; j++) { if ((i & j) == n) { ans++; } } } System.out.println(ans); } }