#include <iostream>
using namespace std;
int _s,a,b;
bool solve(int c,int n,int s){
      if(!n) return s==_s;
      if(c>=10) return false;
      return solve(c+1,n-1,s+c) || solve(c+1,n,s);
}
int main(){
      for(;;){
      cin >> a >> _s;
      if(!a)break;
      cout <<((solve(0,a,0))?"YES":"NO")<< endl;
      }
}