// No.2063 ±2^k operations (easy) package main import ( "bufio" "fmt" "os" "strings" ) func main() { sc := bufio.NewScanner(os.Stdin) sc.Buffer(make([]byte, 0, 200000), 200000) sc.Scan() X := sc.Text() pos1 := strings.Index(X, "1") if pos1 < 0 { fmt.Println("No") // "0", n -> 0 } else { count1 := strings.Count(X[pos1:], "1") if count1 < 2 { fmt.Println("No") // "10*", n -> 1 (-) } else if count1 == 2 { fmt.Println("Yes") // "10*10*", n -> 1 (-)(-) } else { pos0 := strings.Index(X[pos1:], "0") if pos0 < 0 { pos0 = len(X) } if pos0-pos1 == count1 { fmt.Println("Yes") // "11+0*", n -> 2 (+)(-) } else { fmt.Println("No") // "1+0+1.*", n -> 2 (+)(-) } } } }