PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#GL0000125. Bài toán chia số (Another Problem About Dividing Numbers)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

1 lộ trình

Bài toán chia số (Another Problem About Dividing Numbers)

Another Problem About Dividing Numbers

Source: Codeforces

Version: Phuoc Hung OJ Extended

Problem Statement

Given positive integers a,ba,b and a positive integer kk, one operation chooses either current number, selects an integer divisor c>1c>1, and replaces the chosen number by its quotient upon division by cc. Determine whether the two numbers can be made equal in exactly kk operations. Every operation must divide one number by an integer greater than 1.

Input

A single line contains three integers a,b,ka,b,k.

Output

Print YES if possible and NO otherwise.

Subtasks

  • Subtask 1 (20 points): 1≤a≤1001\le a\le 100; 1≤b≤1001\le b\le 100; 1≤k≤1001\le k\le 100.
  • Subtask 2 (30 points): 1≤a≤1 000 0001\le a\le 1\,000\,000; 1≤b≤1 000 0001\le b\le 1\,000\,000; 1≤k≤1 000 0001\le k\le 1\,000\,000.
  • Subtask 3 (50 points): 1≤a≤1 000 000 0001\le a\le 1\,000\,000\,000; 1≤b≤1 000 000 0001\le b\le 1\,000\,000\,000; 1≤k≤1 000 000 0001\le k\le 1\,000\,000\,000.

Examples

Input

2 8 1

Output

YES

Explanation

In one move, divide 8 by 4 to obtain 2, so the two numbers become equal.