#include <iostream>
#include <algorithm>
#include <vector>
#include <cstdlib>
#include <string>
#include <cctype>
#include <cassert>
using namespace std;

#define rep(i,n) for(int i = 0; i < n; i++)
typedef long long ll;

string s;
size_t cur;

bool clause(){
  vector<int> nums;
  if(s[cur] == '~'){
    cur++;
    nums.push_back(-s[cur++]);
  }else{
    nums.push_back(s[cur++]);
  }
  assert(s[cur++] == '&');
  if(s[cur] == '~'){
    cur++;
    nums.push_back(-s[cur++]);
  }else{
    nums.push_back(s[cur++]);
  }
  assert(s[cur++] == '&');
  if(s[cur] == '~'){
    cur++;
    nums.push_back(-s[cur++]);
  }else{
    nums.push_back(s[cur++]);
  }
  rep(i, 3){
    rep(j, i){
      if(nums[i] + nums[j] == 0) return false;
    }
  }
  return true;
}

bool expression(){

  while(cur < s.size()){
    assert(s[cur] == '(');
    cur++;
    if(clause()) return true;
    assert(s[cur++] ==')');
    if(cur < s.size()){
      assert(s[cur++] == '|');
    }
  }
  return false;
}

int main(){
  while(getline(cin, s) && s != "#"){
    cur = 0;
    if(expression()) cout << "yes" << endl;
    else cout << "no" << endl;
  }
  return 0;
}