Last week, Hamed learned about a new type of equations in his math class called Modular Equations. Lets define i modulo j as the remainder of division of i by j and denote it by <image>. A Modular Equation, as Hamed's teacher described, is an equation of the form <image> in which a and b are two non-negative integers and x is a variable. We call a positive integer x for which <image> a solution of our equation.

Hamed didn't pay much attention to the class since he was watching a movie. He only managed to understand the definitions of these equations.

Now he wants to write his math exercises but since he has no idea how to do that, he asked you for help. He has told you all he knows about Modular Equations and asked you to write a program which given two numbers a and b determines how many answers the Modular Equation <image> has.

Input

In the only line of the input two space-separated integers a and b (0 ≤ a, b ≤ 109) are given.

Output

If there is an infinite number of answers to our equation, print "infinity" (without the quotes). Otherwise print the number of solutions of the Modular Equation <image>.

Examples

Input

21 5


Output

2


Input

9435152 272


Output

282


Input

10 10


Output

infinity

Note

In the first sample the answers of the Modular Equation are 8 and 16 since <image>

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Map;
import java.util.StringTokenizer;
import java.util.Collections;


public class algorithms{

    public static void main(String[] args) throws IOException {
    	MyScanner in = new MyScanner();
    	Task282B task = new Task282B();
    	task.slove(in);
    }

    public static class Task282A {
    	public void slove(MyScanner in) {
    		String tmp = in.nextLine();
    		int first = Character.getNumericValue(tmp.charAt(0));
    		int second = Character.getNumericValue(tmp.charAt(1));
    		int arr[] = new int [10];
    		arr[0] = 2;
    		arr[1] = 7;
    		arr[2] = 2;
    		arr[3] = 3;
    		arr[4] = 3;
    		arr[5] = 4;
    		arr[6] = 2;
    		arr[7] = 5;
    		arr[8] = 1;
    		arr[9] = 2;
    		int answer = arr[first]*arr[second];
    		System.out.println(answer);
    	}
    	
    }
    
    public static class Task282B {
    	public void slove(MyScanner in) {
    		long a = in.nextInt();
    		long b = in.nextInt();
    		if (a < b) {
    			System.out.println(0);
    			return;
    		}
    		long delta = a - b;
//    		System.out.println(delta);
    		double d = Math.sqrt(delta);
//    		System.out.println(d);
//    		int r = (int) d;
    		long count = 0;
    		if (a == b) {
    			System.out.println("infinity");
    		} else {
//    			int j = 1;
//    			int prevj = j;
        		for (long i = 1; i*i <= delta;i++) {
//        			if (a%i == b) {
//        				count++;
//        			}
        			
//        			System.out.println(a%i);
        			if (delta % i == 0) {
        				if (i > b) {
	        				count++;
        				}
        				if (delta/i != i && (delta/i > b)) {
        					count++;
        				}
        			}
         		}
    			System.out.println(count);
    		}
    	}
    	
    }
    
    public static class Task2014A {
    	public void slove(MyScanner in) {
    		int n = in.nextInt();
    		int t = in.nextInt();
    		int arr [] = new int [n-1];
    		String answer = "NO";
    		for (int i = 0; i < n-1;i++) {
    			arr[i] = in.nextInt();
    		}
    		int index = 1;
    		while (index <= n-1){
    			if (index == t) {
    				answer = "YES";
    				break;
    			}
    			index = arr[index-1] + index;
    		}
    		if (index == t) {
				answer = "YES";
			}
    		System.out.println(answer);
    	}
    	
    }
    
    public static class Task2014B {
    	public int arr [];
    	public int mat [][];
    	public int n;
    	public void slove(MyScanner in) {
    		n = in.nextInt();
    		arr = new int [n];
    		mat = new int [n][n];
    		for (int i = 0; i < n;i++) {
    			arr[i] = in.nextInt();
    		}
    		for (int i = 0; i < n;i++) {
    			String t = in.nextLine();
    			for (int j = 0; j < n; j++) {
    				if (t.charAt(j) == '0') {
    					mat[i][j] = 0;
    				} else {
    					mat[i][j] = 1;
    				}
    			}
    		}
    		mutable(0,0,n,n);
//    		mutable(0,0,n,n);
    		for (int i = 0; i < n;i++) {
    			System.out.print(arr[i] + " ");
    		}
    	}
    	public void mutable(int i_, int j_, int ni, int nj) {
    		for (int i = i_; i < ni;i++) {
    			if (j_ < i+1) {
    				j_ = i+1;
    			}
    			for (int j = j_; j < nj; j++) {
    				if (mat[i][j] == 1 && arr[j] < arr[i]) {
	    				int tmp = arr[i];
	    				arr[i] = arr[j];
	    				arr[j] = tmp;
	    				for (int k = 0; k < n; k++) {
	    					if (mat[i][k] == 1) {
	    						mutable(k, i, k+1, i+1);
	    					}
	    				}
    				}
    			}

    		}
    	}
    	
    }
    
//    public static class Task2014C {
//    	public void slove(MyScanner in) {
//    		int n = in.nextInt();
//    		int m = in.nextInt();
//    		int w [] = new int [n];
//    		int b [] = new int [m];
//    		for (int i = 0; i < n;i++) {
//    			w[i] = in.nextInt();
//    		}
//    		for (int i = 0; i < m;i++) {
//    			b[i] = in.nextInt();
//    		}
//    		while (){
//
//    		}
//    		System.out.println();
//    	}
//    	
//    }
    
    public static class Task284A {
    	public void slove(MyScanner in) {
    		int n = in.nextInt();
    		int x = in.nextInt();
    		int l, r, count = 0, current = 1, b2;
    		for (int i = 0; i < n;i++) {
    			l = in.nextInt();
    			r = in.nextInt();
    			b2 = (l - current)/x;
    			if (b2 >= 1) {
    				current += x*b2; 
    			}
    			count += r - current + 1;
    			current = r+1;
    		}
    		System.out.println(count);
    	}
    	
    }
    
    public static class Task284B {
    	public void slove(MyScanner in) {
    		int n = in.nextInt();
    		int m = in.nextInt();
    		Map<String, String> map = new HashMap<String, String>();
    		String s, answer = "";
    		for (int i = 0; i < m;i++) {
    			s = in.nextLine();
    			String arr [] = s.split(" ");
    			if (arr[1].length() < arr[0].length()) {
    				map.put(arr[0], arr[1]);
    			} else {
    				map.put(arr[0], arr[0]);
    			}
    		}
    		s = in.nextLine();
    		for (String retval: s.split(" ")){
    			answer += map.get(retval) + " ";
    		}
    		System.out.println(answer);
    	}
    	
    }
    
    public static class Task284C {
    	public void slove(MyScanner in) {
    		long x = in.nextInt();
    		long y = in.nextInt();
    		Point pa = new Point(x, y);
    		x = in.nextInt();
     		y = in.nextInt();
    		Point pb = new Point(x, y);
    		int count = 0;
    		int n = in.nextInt();
    		long a, b, c;
    		for (int i = 0; i < n;i++) {
        		a = in.nextInt();
         		b = in.nextInt();
         		c = in.nextInt();
         		if (pa.onOneSide(pb, a, b, c) == false) {
         			count++;
         		}
    		}
    		System.out.println(count);
    	}
    	
    }
    
    public static class Point {
    		   
    	public long x;
    	public long y;
    	
    	public Point(long x, long y) {
    		this.x = x;
    		this.y = y;
    	}
    	
    	public boolean onOneSide(Point p, long a, long b, long c) {
    		long d2 = a*p.x + b*p.y + c;
    		long d1 = a*this.x + b*this.y + c;
    		if ((d2 > 0 && d1 < 0) || (d1 > 0 && d2 < 0)) {
    			return false;
    		}
    		return true;
    	}
    }
    
    public static class TaskA {
    	public void slove(MyScanner in) {
    		int n = in.nextInt();
    		int prev = 0, prevprev = 0, diff, answer;
    		int min = 1000, max = 0;
    		int imin = 1;
    		int arr [] = new int [n];
    		for (int i = 0; i < n;i++) {
    			arr[i] = in.nextInt();
    			if (i != 0) {
    				if (i > 1) {
		    			diff = arr[i] - prevprev;
		    			if (diff < min) {
		    				min = diff;
		    				imin = i;
		    			}
    				}
	    			if ((arr[i] - prev) > max) {
	    				max = arr[i] - prev;
	    			}
    			}
    			prevprev = prev;
    			prev = arr[i];
    		}
    		diff = arr[imin] - arr[imin-2];
    		if (diff > max) {
    			answer = diff;
    		} else {
    			answer = max;
    		}
    		
    		System.out.println(answer);
    	}
    	
    }
    
    public static class TaskB {
    	public int arr [];
    	public int n;
    	public void slove(MyScanner in) {
    		n = in.nextInt();
    		arr = new int [n];
    		int count[] = new int [10];
    		String s = in.nextLine();
    		String min = s, num;
    		for (int i = 0; i < n;i++) {
    			arr[i] = Character.getNumericValue(s.charAt(i));
    			count[arr[i]] += 1;
    		}
    		for (int i = 0; i < 10;i++) {
    			if (count[i] == 0) {
    				continue;
    			}
    			num = getSmallestInt(10 - i);
    			for (int j = 0; j < num.length();j++) {
	    			if (num.charAt(j) < min.charAt(j)) {
	    				min = num;
	    			}
	    			if (num.charAt(j) != min.charAt(j)) {
	    				break;
	    			}
    			}
    			
    		}
    		String answer = "";
    		answer += min;
    		System.out.println(answer);
    	}
    	
    	public String getSmallestInt(int offset) {
    		StringBuffer tmp = new StringBuffer();
    		long newvalue;
    		ArrayList<Integer> al = new ArrayList<Integer>();
			for (int i = 0; i < n;i++) {
				newvalue = arr[i] + offset;
				if (newvalue >= 10) {
					newvalue -= 10;
					if (newvalue == 0) {
						al.add(i);
					}
				}
				tmp.append((int)newvalue);
    		}
			String str = tmp.toString();
			String newstr;
			String min = String.format("%0" + n + "d", 0).replace("0","9");
			for(int i = 0; i < al.size(); i++) {
				newstr = str.substring(al.get(i)) + str.substring(0, al.get(i));
	    		for (int j = 0; j < newstr.length();j++) {
	    			if (newstr.charAt(j) < min.charAt(j)) {
	    				min = newstr;
	    			}
	    			if (newstr.charAt(j) != min.charAt(j)) {
	    				break;
	    			}
	    		}
			}
    		return min;
    	}
    	
    }
    
    public static class TaskC {
    	public void slove(MyScanner in) {
    		int n = in.nextInt();
    		int m = in.nextInt();
    		String arr [] = new String [n];
    		char prev = ' ';
    		int count = 0;
    		for (int i = 0; i < n;i++) {
    			arr[i] = in.nextLine();
    		}
    		char c;
    		ArrayList<Integer> ignore = new ArrayList<Integer>();
    		ArrayList<Integer> ignorenext = new ArrayList<Integer>();
    		for (int i = 0; i < m;i++) {
    			prev = ' ';
    			for (int j = 0; j < n;j++) {
    				c = arr[j].charAt(i);
        			if (ignore.contains(j)) {
        				prev = c;
        				continue;
        			}
    				if (c > prev && prev != ' ') {
    					if (ignorenext.contains(j) == false) {
    						ignorenext.add(j);
    					}
    				}
    				if (c < prev) {
    					count++;
    					ignorenext.clear();
    					break;
    				}
    				prev = c;
    			}
    			ignore.addAll(ignorenext);
    			ignorenext.clear();
    		}
    		System.out.println(count);
    	}
    	
    }
    
    
    public static class TaskD {
    	public void slove(MyScanner in) {
    		int n = in.nextInt();
    		int s = 0, t = 0;
    		int count1 = 0, count2 = 0;
    		int max = 0;
    		int arr[] = new int [n];
    		for (int i = 0; i < n; i++) {
    			arr[i] = in.nextInt();
    			if (arr[i] == 1) {
    				count1++;
    			} else {
    				count2++;
    			}
    		}
    		if (count1 != count2) {
    			if (count1 > count2) {
    				max = count1;
    			} else {
    				max = count2;
    			}
    			int x = 1, y = max;
    			while (max/x >= 1) {
    				if (max%x == 0) {
    					y = max/x;
    					System.out.println(x + " " + y);
    				}
    				x++;
    			}
    		}

    		System.out.println(s + " " + t);
    	}
    	
    }
    
    public static class Pair implements Comparable<Pair> {
	  public final Comparator<Pair> SLOPE_ORDER = new Comparator<Pair>() {
		   // compare points by slope to this point
		       public int compare(Pair p1, Pair p2) {
		    	   return p1.compareTo(p2);
		       }
		};
    		   
    	private long min;
    	public long max;
    	private long count;
    	private int num;
    	
    	public Pair(long min, long max, long count, int num) {
    		this.min = min;
    		this.max = max;
    		this.count = count;
    		this.num = num;
    	}
    	
    	public void decrease() {
    		count--;
    	}
    	
    	public long count() {
    		return count;
    	}
    	
    	public int num() {
    		return num;
    	}
    	
		public int compareTo(Pair that) {
	       if ((this.min == that.min) && (this.max == that.max)) {
	           return 0;
	       }
	       if ((this.min < that.min) || (this.min == that.min && this.max < that.max)) {
	           return -1;
	       } 
	       return 1;
		}
		
		public int contain(Pair that) {
//			System.out.println(this.min);
//			System.out.println(this.max);
//			System.out.println(that.min);
//			System.out.println(that.max);
		       if ((this.min <= that.min) && (this.max >= that.max)) {
		           return 1;
		       }
		       if (this.min <= that.min) {
		    	   return 0;
		       }
		       return -1;
			}
    }
    
    public static class TaskE {
    	public void slove(MyScanner in) {
    		int n = in.nextInt();
    		Pair parties[] = new Pair [n];
    		int p_a[] = new int [n];
    		long min, max;
    		long count;
    		for (int i = 0; i< n;i++) {
    			min = in.nextLong();
    			max = in.nextLong();
    			parties[i] = new Pair(min, max, 0, i+1);
    		}
    		Arrays.sort(parties);
//    		for (int i = 0; i< n;i++) {
//    			System.out.println(parties[i].num());
//    		}
    		int m = in.nextInt();
    		Pair actors[] = new Pair [m];
    		for (int i = 0; i< m;i++) {
    			min = in.nextLong();
    			max = in.nextLong();
    			count = in.nextLong();
    			actors[i] = new Pair(min, max, count, i+1);
    		}
    		Arrays.sort(actors);
//    		for (int i = 0; i< m;i++) {
//    			System.out.println(actors[i].num());
//    		}
    		int j = 0;
    		Pair partie;
    		String answer = "YES\n";
    		for (int i = 0; i< n;i++) {
    			partie = parties[i];
//    			actor = actors[j];
//    			System.out.println(actor.count());
    			if (actors[j].count() <= 0) {
    				if (j == (m)) {
    					answer = "NO";
    					break;
    				}
    				j++;
//    				actor = actors[j];
    			}
//    			System.out.println(actor.contain(partie));
//    			Pair suitable_actor = null;
    			int index_actor = -1;
    			long min_max = 10000000000L;
    			for(int k = j; k< m; k++) {
    				if (actors[k].count() <= 0) {
    					continue;
    				}
	    			int contain = actors[k].contain(partie);
	    			if (contain == 1) {
//	    				System.out.println(actors[k].max);
	    				if (actors[k].max < min_max){
	    					index_actor = k;
	    					min_max = actors[k].max;
	    				}
	    				
//	    				actors[k].decrease();
//	    				System.out.println(actors[k].count());
//	    				System.out.println(partie.num());
//	    				System.out.println(actors[k].num());
//	    				p_a[partie.num()-1] = actors[k].num();
//	    				break;
	    			} else if (contain == -1){
//	    				answer = "NO";
						break;
	    			}
    			}
    			if (index_actor == -1) {
    				answer = "NO";
    				break;
    			}
//    			System.out.println(actors[index_actor].num);
    			actors[index_actor].decrease();
    			p_a[partie.num()-1] = actors[index_actor].num();
    			
    		}
    		if (answer != "NO") {
    			for (int i = 0; i< n;i++) {
    				if (p_a[i] == 0) {
    					answer = "NO";
    					break;
    				}
    				answer += p_a[i] + " ";
    			}
    		}
    		System.out.println(answer);
    	}
    	
    }
    
    public static class TaskDold {
    	public void slove(MyScanner in) {
    		int n = in.nextInt();
    		Boolean ok = true;
    		int arr [][] = new int [n][n];
    		int minj [] = new int [n];
    		int min = 1000000000;
    		int min_j = 0;
    		for (int i =0; i< n;i++) {
    			min = 1000000001;
    			min_j = 0;
    			for (int j=0; j< n; j++) {
    				arr[i][j] = in.nextInt();
    				if (arr[i][j] < min && (i != j)) {
    					min = arr[i][j];
    					min_j = j;
    				}
    				if ((i == j) && (arr[i][j] != 0)) {
    					ok = false;
    				}
    				if ((i > j) && (arr[i][j] != arr[j][i])) {
    					ok = false;
    				}
    				if ((i != j) && (arr[i][j] == 0)) {
    					ok = false;
    				}
    			}
    			minj[i] = min_j;
    			for (int j =0; j< i;j++) {
    				if ((j == min_j) && (minj[j] == i))
    				{
    					
    				}
    			}
    		}
    		if (!ok) {
    			System.out.println("NO");
    			return;
    		}
    		int j;
    		for (int i =0; i< n;i++) {
    			min_j = minj[i];
//    			System.out.println(min_j);
    			for (j =0; j< i;j++) {
					if ((j == min_j) && (minj[j] == i))
					{
						
					}
    				if (minj[j] == min_j) {
//    					System.out.println(arr[i][j]);
//    					System.out.println(arr[j][minj[j]]);
//    					System.out.println(arr[i][min_j]);
    					if (arr[i][j] != (arr[j][minj[j]] + arr[i][min_j])) {
    						System.out.println("NO");
    		    			return;
    					}
    				}
    			}
    			
    		}
    		
    		System.out.println("YES");
    	}
    	
    }
    
    
    public static class MyScanner {
		BufferedReader br;
		StringTokenizer st;

		public MyScanner() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String next() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}

	}

}