#include <iostream>
#include <cstdlib>
#include <bitset>
#include <map>
#include <iomanip>
#include <string>
#include <vector>
#include <cmath>
#include <queue>
#include <algorithm>
#include <sstream>

using namespace std;

#define ll long long
#define vecll vector<long long>
#define vec2ll vector<vector<long long>>
#define vecdouble vector<double>
#define vecchar vector<char>
#define vecstr vector<string>
#define vec2str vector<vector<string>>
#define vecbool vector<bool>
#define vec2bool vector<vector<bool>>
#define pairll pair<ll,ll>
#define vecpairll vector<pair<long long,long long>>
#define forll(s,a,b) for(long long s = a;s < b;s++)
#define forllde(s,a) for(long long s = a;s >= 0;s--)

#define INF 1000000000000
#define Pi 3.1415926535897932384626

int main() {
	ll x,y,a,b, ans = 0;
	string s = "No";
	bool flag = false;

	cin >> x >> y >> a >> b;

	while (x < y)
	{
		if (x*a >= y && x + b >= y)
			break;
		else if ((double)x*(double)a < (double)x + (double)b)
		{
			ans++;
			x *= a;
		}
		else
		{
			ll buf = (y - 1 - x) / b;
			ans+=buf;
			x += b * buf;

			break;
		}
	}



	cout << ans;
}
#include <bits/stdc++.h>
#include <iostream>
using namespace std;
#define ll long long
#define ld long double
#define mp make_pair
#define pb push_back
#define fo(i,n) for(ll i=0;i<n;i++)
#define fo1(i,n) for(ll i=1;i<=n;i++)
#define loop(i,a,b)for(ll i=a;i<=b;i++)
#define loopr(i,a,b)for(ll i=b;i>=a;i--)
#define all(x) x.begin(), x.end()
#define sz(x) (ll)(x).size()
#define vll vector<ll>
#define vvl vector<vll>
#define pll pair<ll,ll>
#define F first
#define S second
#define MOD 1000000007
ll max(ll a,ll b){if (a>b) return a; else return b;}
ll gcd(ll a, ll b){if(b==0)return a;return gcd(b, a%b);}
ll lcm(ll a, ll b){return a*b/gcd(a, b);}
ll fexp(ll a, ll b){ll ans = 1;while(b){if(b&1) ans = ans*a%MOD; b/=2;a=a*a%MOD;}return ans;}
ll inverse(ll a, ll p){return fexp(a, p-2);}

int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	ll T=1;
    //cin >> T;
	ll t=0;
	while(t++<T){
    ll N;
    cin >> N;
    vll a(N),b(N);
    fo(i,N) cin >> a[i];
    fo(i,N) cin >> b[i];
    ll s=0;
    fo(i,N) s+=a[i]*b[i];
    if(s==0) cout << "Yes" << endl;
    else cout << "No" << endl;
    }
return 0;
}