#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cctype>
#include <climits>
#include <complex>
using namespace std;

#define REP(i,n,m) for(int i=n;i<m;i++)
#define rep(i,n) REP(i,0,n)

vector<string> split(string s,char ch){
  int idx = 0;
  vector<string> res;

  while(idx < s.length()){
    if(s[idx] == ch){
      res.push_back(s.substr(0,idx));
      s = s.substr(idx+1);
      idx = 0;
    }
    else{
      idx++;
    }
  }

  res.push_back(s);

  return res;
}

int main(){
  string s;

  while(cin>>s,s!="#"){
    vector<string> v = split(s,'|');
    bool ans = false;

    rep(i,v.size()){
      vector<string> vv = split(v[i].substr(1,v[i].length()-2),'&');
      char name[3];
      bool flg[3];

      rep(j,3){
        if(vv[j][0] == '~'){
          name[j] = vv[j][1];
          flg[j] = false;
        }
        else{
          name[j] = vv[j][0];
          flg[j] = true;
        }
      }

      if(name[0] == name[1] && name[0] == name[2]){
        if(flg[0] == flg[1] && flg[0] == flg[2]){
          ans = true;
          break;
        }
      }
      else if(name[0] != name[1] && name[0] != name[2] && name[1] != name[2]){
        ans = true;
        break;
      }
      else if(name[0] == name[1]){
        if(flg[0] == flg[1]){
          ans = true;
          break;
        }
      }
      else if(name[0] == name[2]){
        if(flg[0] == flg[2]){
          ans = true;
          break;
        }
      }
      else if(name[1] == name[2]){
        if(flg[1] == flg[2]){
          ans = true;
          break;
        }
      }
    }

    cout<<(ans ? "yes" : "no")<<endl;
  }
}