CF108B.Datatypes

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Tattah's youngest brother, Tuftuf, is new to programming.

Since his older brother is such a good programmer, his biggest dream is to outshine him. Tuftuf is a student at the German University in Cairo (GUC) where he learns to write programs in Gava.

Today, Tuftuf was introduced to Gava's unsigned integer datatypes. Gava has nn unsigned integer datatypes of sizes (in bits) a1,a2,... ana_{1},a_{2},...\ a_{n} . The ii -th datatype have size aia_{i} bits, so it can represent every integer between 00 and 2ai12^{a_{i}}-1 inclusive.

Tuftuf is thinking of learning a better programming language. If there exists an integer xx , such that xx fits in some type ii (in aia_{i} bits) and xxx·x does not fit in some other type jj (in aja_{j} bits) where a_{i}<a_{j} , then Tuftuf will stop using Gava.

Your task is to determine Tuftuf's destiny.

输入格式

The first line contains integer nn ( 2<=n<=1052<=n<=10^{5} ) — the number of Gava's unsigned integer datatypes' sizes. The second line contains a single-space-separated list of nn integers ( 1<=ai<=1091<=a_{i}<=10^{9} ) — sizes of datatypes in bits. Some datatypes may have equal sizes.

输出格式

Print "YES" if Tuftuf will stop using Gava, and "NO" otherwise.

输入输出样例

  • 输入#1

    3
    64 16 32
    

    输出#1

    NO
    
  • 输入#2

    4
    4 2 1 3
    

    输出#2

    YES
    

说明/提示

In the second example, x=7x=7 (1112)(111_{2}) fits in 33 bits, but x2=49x^{2}=49 (1100012)(110001_{2}) does not fit in 44 bits.

首页